home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / dostech.arc / CHAP4 < prev    next >
Text File  |  1989-02-04  |  136KB  |  2,778 lines

  1. CHAPTER 4
  2.  
  3.  Programming Technical Reference - IBM
  4.  Copyright 1988, Dave Williams
  5.  
  6.  
  7.                     DOS INTERRUPTS AND FUNCTION CALLS
  8. CONTENTS
  9.  
  10. DOS Registers ........................................................... 4-
  11. Interrupts .............................................................. 4-
  12.         20h Program Terminate ........................................... 4-
  13.         21h Function Request ............................................ 4-
  14.             Function Calls .............................................. 4-
  15.             Listing of Function Calls ................................... 4-
  16.                 00h Program Terminate ................................... 4-
  17.                 01h Keyboard Input ...................................... 4-
  18.                 02h Display Output ...................................... 4-
  19.                 03h Auxiliary Input ..................................... 4-
  20.                 04h Auxiliary Output .................................... 4-
  21.                 05h Printer Output ...................................... 4-
  22.                 06h Direct Console I/O .................................. 4-
  23.                 07h Direct Console Input Without Echo ................... 4-
  24.                 08h Console Input Without Echo ...........................4-
  25.                 09h Print String .........................................4-
  26.                 0Ah Buffered Keyboard Input ..............................4-
  27.                 0Bh Check Standard Input Status ..........................4-
  28.                 0Ch Clear Keyboard Buffer and Invoke a Kbd Function ..... 4-
  29.                 0Dh Disk Reset .......................................... 4-
  30.                 0Eh Select Disk ......................................... 4-
  31.                 0Fh Open File ........................................... 4-
  32.                 10h Close File .......................................... 4-
  33.                 11h Search for First Entry .............................. 4-
  34.                 12h Search for Next Entry ............................... 4-
  35.                 13h Delete File ......................................... 4-
  36.                 14h Sequential Read ..................................... 4-
  37.                 15h Sequential Write .................................... 4-
  38.                 16h Create File ......................................... 4-
  39.                 17h Rename File ......................................... 4-
  40.                 18h ** Unknown .......................................... 4-
  41.                 19h Current Disk ........................................ 4-
  42.                 1Ah Set Disk Transfer Address ........................... 4-
  43.                 1Bh Allocation Table Information ........................ 4-
  44.                 1Ch Allocation Table Information for Specific Device .... 4-
  45.                 1Dh ** Unknown .......................................... 4-
  46.                 1Eh ** Unknown .......................................... 4-
  47.                 1Fh ** Read DOS Disk Block (default drive) .............. 4-
  48.                 20h ** Unknown .......................................... 4-
  49.                 21h Random Read ......................................... 4-
  50.                 22h Random Write ........................................ 4-
  51.                 23h File Size ........................................... 4-
  52.                 24h Set Relative Record Field ........................... 4-
  53.                 25h Set Interrupt Vector ................................ 4-
  54.                 26h Create New Program Segment .......................... 4-
  55.                 27h Random Block Read ................................... 4-
  56.                 28h Random Block Write .................................. 4-
  57.                 29h Parse Filename ...................................... 4-
  58.                 2Ah Get Date ............................................ 4-
  59.                 2Bh Get Date ............................................ 4-
  60.                 2Ch Get Time ............................................ 4-
  61.                 2Dh Set Time ............................................ 4-
  62.                 2Eh Set/Reset Verify Switch ............................. 4-
  63.                 2Fh Get Disk Transfer Address (DTA) ..................... 4-
  64.                 30h Get DOS Version Number .............................. 4-
  65.                 31h Terminate Process and Stay Resident ................. 4-
  66.                 32h ** Read DOS Disk Block .............................. 4-
  67.                 33h Ctrl-Break Check .................................... 4-
  68.                 34h ** Return INDOS Flag ................................ 4-
  69.                 35h Get Vector .......................................... 4-
  70.                 36h Get Disk Free Space ................................. 4-
  71.                 37h ** Get/Set Switch Character (SWITCHAR) .............. 4-
  72.                 38h Return Country Dependent Information ................ 4-
  73.                 39h Create Subdirectory (MKDIR) ......................... 4-
  74.                 3Ah Remove Subdirectory (RMDIR) ......................... 4-
  75.                 3Bh Change Durrent Directory (CHDIR) .................... 4-
  76.                 3Ch Create a File (CREAT) ............................... 4-
  77.                 3Dh Open a File ......................................... 4-
  78.                 3Eh Close a File Handle ................................. 4-
  79.                 3Fh Read From a File or Device .......................... 4-
  80.                 40h Write to a File or Device ........................... 4-
  81.                 41h Delete a File from a Specified Directory (UNLINK) ... 4-
  82.                 42h Move File Read/Write Pointer (LSEEK) ................ 4-
  83.                 43h Change File Mode (CHMOD) ............................ 4-
  84.                 44h I/O Control for Devices (IOCTL) ..................... 4-
  85.                 45h Duplicate a File Handle (DUP) ....................... 4-
  86.                 46h Force a Duplicate of a Handle (FORCDUP) ............. 4-
  87.                 47h Get Current Directory ............................... 4-
  88.                 48h Allocate Memory ..................................... 4-
  89.                 49h Free Allocated Memory ............................... 4-
  90.                 4Ah Modify Allocated Memory Blocks (SETBLOCK) ........... 4-
  91.                 4Bh Load or Execute a Program (EXEC) .................... 4-
  92.                 4Ch Terminate a Process (EXIT) .......................... 4-
  93.                 4Dh Get Return Code of a Subprocess (WAIT) .............. 4-
  94.                 4Eh Find First Matching File (FIND FIRST) ............... 4-
  95.                 4Fh Find Next Matching File (FIND NEXT) ................. 4-
  96.                 50h ** Set PSP .......................................... 4-
  97.                 51h ** Get PSP .......................................... 4-
  98.                 52h ** IN-VARS .......................................... 4-
  99.                 53h ** Translate BPB .................................... 4-
  100.                 54h Get Verify Setting .................................. 4-
  101.                 55h ** Create Child PSP ................................. 4-
  102.                 56h Rename a File ....................................... 4-
  103.                 57h Get or Set Timestamp of a File ...................... 4-
  104.                 58h ** Get/Set Allocation Strategy (DOS 3.x) ............ 4-
  105.                 59h Get Extended Error Code ............................. 4-
  106.                 5Ah Create Unique Filename .............................. 4-
  107.                 5Bh Create a New File ................................... 4-
  108.                 5Ch Lock/Unlock File Access ............................. 4-
  109.                 5Dh ** Network - Partial ................................ 4-
  110.                 5Eh ** Network Printer .................................. 4-
  111.                 5Fh ** Network Redirection .............................. 4-
  112.                 60h ** Parse Pathname ................................... 4-
  113.                 61h ** Unknown .......................................... 4-
  114.                 62h Get Program Segment Prefix (PSP) Address ............ 4-
  115.                 63h ** Get Lead Byte Table (DOS 2.25) ................... 4-
  116.                 64h ** Unknown .......................................... 4-
  117.                 65h ** Get Extended Country Information (DOS 3.3) ....... 4-
  118.                 66h ** Get/Set Global Code Page Table (DOS 3.3) ......... 4-
  119.                 67h ** Set Handle Count (DOS 3.3) ....................... 4-
  120.                 68h ** Commit File (DOS 3.3) ............................ 4-
  121.             Calling the DOS Services .................................... 4-
  122.         22h Terminate Address ........................................... 4-
  123.         23h Ctrl-Break Exit Address ..................................... 4-
  124.         24h Critical Error Handler Vector ............................... 4-
  125.         25h Absolute Disk Read .......................................... 4-
  126.         26h Absolute Disk Write ......................................... 4-
  127.         27h Terminate and Stay Resident ................................. 4-
  128.         28h ** DOS Idle Interrupt ....................................... 4-
  129.         29h ** Quick Screen Output ...................................... 4-
  130.         2Ah Microsoft Networks Session Layer Interrupt .................. 4-
  131.         2Bh ** Unknown .................................................. 4-
  132.         2Ch ** Unknown .................................................. 4-
  133.         2Dh ** Unknown .................................................. 4-
  134.         2Eh ** Alternate EXEC ........................................... 4-
  135.         2Fh Multiplex Interrupt ......................................... 4-
  136.  
  137.  
  138.  
  139.  
  140. DOS REGISTERS
  141.  
  142.  DOS uses the following registers, pointers, and flags when it executes
  143. interrupts and function calls:
  144.  
  145. GENERAL REGISTERS    register                definition
  146.                         AX      accumulator (16 bit)
  147.                         AH      accumulator high-order byte (8 bit)
  148.                         AL      accumulator low order byte (8 bit)
  149.                         BX      base (16 bit)
  150.                         BH      base high-order byte (8 bit)
  151.                         BL      base low-order byte (8 bit)
  152.                         CX      count (16 bit)
  153.                         CH      count high order byte (8 bit)
  154.                         CL      count low order byte (8 bit)
  155.                         DX      data (16 bit)
  156.                         DH      date high order byte (8 bit)
  157.                         DL      data low order byte (8 bit)
  158.  
  159. FLAGS                   AF, CF, DF, IF, OF, PF, SF, TF, ZF
  160.  
  161. POINTERS             register        definition
  162.                         SP      stack pointer (16 bit)
  163.                         BP      base pointer (16 bit)
  164.                         IP      instruction pointer (16 bit)
  165.  
  166. SEGMENT REGISTERS    register       definition
  167.                         CS      code  segment (16 bit)
  168.                         DS      data  segment (16 bit)
  169.                         SS      stack segment (16 bit)
  170.                         ES      extra segment (16 bit)
  171.  
  172. INDEX REGISTERS      register        definition
  173.                         DI      destination index (16 bit)
  174.                         SI      stack       index (16 bit)
  175.  
  176.  
  177. INTERRUPTS
  178.  
  179.  Microsoft recommends that a program wishing to examine or set the contents of
  180. any interrupt vector use the DOS function calls 35h and 25h provided for those
  181. purposes and avoid referencing the interrupt vector locations directly.
  182.  DOS reserves interrupt numbers 20h to 3Fh for its own use. This means absolute
  183. memory locations 80h to 0FFh are reserved by DOS. The defined interrupts are as
  184. follows with all values in hexadecimal.
  185.  
  186.  
  187. Interrupt 21h   FUNCTION CALL REQUEST
  188. (0:0084h)
  189.  DOS provides a wide variety of function calls for character device I/O, file
  190. management, memory management, date and time functions,execution of other
  191. programs, and more. They are grouped as follows:
  192.  
  193.           call              description
  194.         00h             program terminate
  195.         01h-0Ch         character device I/O, CP/M compatibility format
  196.         0Dh-24h         file management,      CP/M compatibility format
  197.         25h-26h         nondevice functions,  CP/M compatibility format
  198.         27h-29h         file management,      CP/M compatibility format
  199.         2Ah-2Eh         nondevice functions,  CP/M compatibility format
  200.         2Fh-38h         extended functions
  201.         39h-3Bh         directory group
  202.         3Ch-46h         extended file management
  203.         47h             directory group
  204.         48h-4Bh         extended memory management
  205.         54h-57h         extended functions
  206.         5Eh-5Fh         networking
  207.         60h-62h         extended functions
  208.         63h-66h         enhanced foreign language support
  209.  
  210.  
  211. List of DOS services:   * = undocumented
  212.         00h     terminate program
  213.         01h     get keyboard input
  214.         02h     display character to STDIO
  215.         03h     get character from STDAUX
  216.         04h     output character to STDAUX
  217.         05h     output character to STDPRN
  218.         06h     direct console I/O - keyboard to screen
  219.         07h     get char from std I/O without echo
  220.         08h     get char from std I/O without echo, checks for ^C
  221.         09h     display a string to STDOUT
  222.         0Ah     buffered keyboard input
  223.         0Bh     check STDIN status
  224.         0Ch     clear keyboard buffer and invoke keyboard function
  225.         0Dh     flush all disk buffers
  226.         0Eh     select disk
  227.         0Fh     open file with File Control Block
  228.         10h     close file opened with File Control Block
  229.         11h     search for first matching file entry
  230.         12h     search for next matching file entry
  231.         13h     delete file specified by File Control Block
  232.         14h     sequential read from file specified by File Control Block
  233.         15h     sequential write to file specified by File Control Block
  234.         16h     find or create firectory entry for file
  235.         17h     rename file specified by file control block
  236.         18h*    unknown
  237.         19h     return current disk drive
  238.         1Ah     set disk transfer area (DTA)
  239.         1Bh     get current disk drive FAT
  240.         1Ch     get disk FAT for any drive
  241.         1Dh*    unknown
  242.         1Eh*    unknown
  243.         1Fh*    read DOS disk block, default drive
  244.         20h*    unknown
  245.         21h     random read from file specified by FCB
  246.         22h     random write to file specified by FCB
  247.         23h     return number of records in file specified by FCB
  248.         24h     set relative file record size field for file specified by FCB
  249.         25h     set interrupt vector
  250.         26h     create new Program Segment Prefix (PSP)
  251.         27h     random file block read from file specified by FCB
  252.         28h     random file block write to file specified by FCB
  253.         29h     parse the command line for file name
  254.         2Ah     get the system date
  255.         2Bh     set the system date
  256.         2Ch     get the system time
  257.         2Dh     set the system time
  258.         2Eh     set/clear disk write VERIFY
  259.         2Fh     get the Disk Transfer Address (DTA)
  260.         30h     get DOS version number
  261.         31h     TSR, files opened remain open
  262.         32h*    read DOS Disk Block
  263.         33h     get or set Ctrl-Break
  264.         34h*    INDOS  Critical Section Flag
  265.         35h     get segment and offset address for an interrupt
  266.         36h     get free disk space
  267.         37h*    get/set option marking character (SWITCHAR)
  268.         38h     return country-dependent information
  269.         39h     create subdirectory
  270.         3Ah     remove subdirectory
  271.         3Bh     change current directory
  272.         3Ch     create and return file handle
  273.         3Dh     open file and return file handle
  274.         3Eh     close file referenced by file handle
  275.         3Fh     read from file referenced by file handle
  276.         40h     write to file referenced by file handle
  277.         41h     delete file
  278.         42h     move file pointer (move read-write pointer for file)
  279.         43h     set/return file attributes
  280.         44h     device IOCTL (I/O control) info
  281.         45h     duplicate file handle
  282.         46h     force a diuplicate file handle
  283.         47h     get current directory
  284.         48h     allocate memory
  285.         49h     release allocated memory
  286.         4Ah     modify allocated memory
  287.         4Bh     load or execute a program
  288.         4Ch     terminate prog and return to DOS
  289.         4Dh     get return code of subprocess created by 4Bh
  290.         4Eh     find first matching file
  291.         4Fh     fine next matching file
  292.         50h*    set new current Program Segment Prefix (PSP)
  293.         51h*    puts current PSP into BX
  294.         52h*    pointer to the DOS list of lists
  295.         53h*    translates BPB (Bios Parameter Block, see below)
  296.         54h     get disk verification status (VERIFY)
  297.         55h*    create PSP: similar to function 26h
  298.         56h     rename a file
  299.         57h     get/set file date and time
  300.         58h     get/set allocation strategy             (DOS 3.x)
  301.         59h     get extended error information
  302.         5Ah     create a unique filename
  303.         5Bh     create a DOS file
  304.         5Ch     lock/unlock file contents
  305.         5Dh*    network
  306.         5Eh*    network printer
  307.         5Fh*    network redirection
  308.         60h*    parse pathname
  309.         61h*    unknown
  310.         62h     get program segment prefix (PSP)
  311.         63h*    get lead byte table                     (DOS 2.25)
  312.         64h*    unknown
  313.         65h*    get extended country information        (DOS 3.3)
  314.         66h*    get/set global code page table          (DOS 3.3)
  315.         67h*    set handle count                        (DOS 3.3)
  316.         68h*    commit file                             (DOS 3.3)
  317.  
  318.  
  319.  CALLING THE DOS SERVICES
  320.  
  321.  The DOS services are invoked by placing the number of the desired function in
  322. register AH, subfunction in AL, setting the other registers to any specific
  323. requirements of the function, and invoking int 21h.
  324.  
  325.  On return, the requested service will be performed if possible. Most codes
  326. will return an error; some return more information. Details are contained in
  327. the listings for the individual functions. Extended error return may be
  328. obtained by calling function 59h (see 59h).
  329.  
  330.  Register settings listed are the ones used by DOS. Some functions will return
  331. with garbage values in unused registers. Do not test for values in unspecified
  332. registers; your program may exhibit odd behavior.
  333.  
  334.  DS:DX pointers are the data segment register (DS) indexed to the DH and DL
  335. registers (DX). DX always contains the offset address, DS contains the segment
  336. address.
  337.  
  338.  The File Control Block services (FCB services) were part of DOS 1.0. Since
  339. the release of DOS 2.0, Microsoft has recommended that these services not be
  340. used. A set of considerably more enhanced services (handle services) were
  341. introduced with DOS 2.0. The handle services provide support for wildcards and
  342. subdirectories, and enhanced error detection via function 59h.
  343.  
  344.  The data for the following calls was compiled from various Intel, Microsoft,
  345. IBM, and other publications. There are many subtle differences between MSDOS
  346. and PCDOS and between the individual versions. Differences between the
  347. versions are noted as they occur.
  348.  
  349.  There are various ways of calling the DOS functions. For all methods, the
  350. function number is loaded into register AH, subfunctions and/or parameters are
  351. loaded into AL or other registers, and call int 21 by one of the following
  352. methods:
  353.  A) call interrupt 21h directly
  354.  B) perform a long call to offset 50h in the program's PSP.
  355.     1) This method will not work under DOS 1.x
  356.  C) place the function number in CL and perform an intrasegment call to
  357.     location 05h in the current code segment. This location contains a long
  358.     call to the DOS function dispatcher.
  359.     1) IBM recommends this method be used only when using existing programs
  360.        written for different calling conventions. This method should be avoided
  361.        unless you some specific use for it
  362.     2) AX is always destroyed by this method
  363.     3) This method is valid only for functions 00h-24h.
  364.  
  365. INT 21H   DOS services
  366.           Function (hex)
  367.  
  368. * Indicates Functions not documented in the IBM DOS Technical Reference.
  369.  Note some functions have been documented in other Microsoft or licensed OEM
  370. documentation.
  371.  
  372.  
  373. 00h   Terminate Program
  374.       Ends program, updates, FAT, flushes buffers, restores registers
  375. entry   AH      00h
  376.         CS      segment address of PSP
  377. return  none
  378. note 1) Program must place the segment address of the PSP control block in CS
  379.         before calling this function.
  380.      2) The terminate, ctrl-break,and critical error exit addresses (0Ah, 0Eh,
  381.         12h) are restored to the values they had on entry to the terminating
  382.         program, from the values saved in the program segment prefix at
  383.         locations PSP:000Ah, PSP:000Eh, and PSP:0012h.
  384.      3) All file buffers are flushed and the handles opened by the process are
  385.         closed.
  386.      4) Any files that have changed in length and are not closed are not
  387.         recorded properly in the directory.
  388.      5) Control transfers to the terminate address.
  389.      6) This call performs exactly the same function as int 20h.
  390.      7) All memory used by the program is returned to DOS.
  391.  
  392.  
  393. 01h     Get Keyboard Input
  394.         Waits for char at STDIN (if nescessary), echoes to STDOUT
  395. entry   AH      01h
  396. return  AL      char from STDIN (8 bits)
  397. note 1) Checks char for Ctrl-C, if char is Ctrl-C, executes int 23h.
  398.      2) For function call 06h, extended ASCII codes require two function calls.
  399.         The first call returns 00h as an indicator that the next call will be an
  400.         extended ASCII code.
  401.      3) Input and output are redirectable. If redirected, there is no way to
  402.         detect EOF.
  403.  
  404.  
  405. 02h   Display Output
  406.       Outputs char in DL to STDOUT
  407. entry   AH      02h
  408.         DL      8 bit data (usually ASCII character)
  409. return  none
  410. note 1) If char is 08 (backspace) the cursor is moved 1 char to the left
  411.         (nondestructive backspace).
  412.      2) If Ctrl-C is detected after input, int 23h is executed.
  413.      3) Input and output are redirectable. If redirected, there is no way to
  414.         detect disk full.
  415.  
  416.  
  417. 03h   Auxiliary Input
  418.       Get (or wait until) character from STDAUX
  419. entry   AH      03h
  420. return  AL      char from auxiliary device
  421. note 1) AUX, COM1, COM2 is unbuffered and not interrupt driven
  422.      2) This function call does not return status or error codes. For greater
  423.         control it is recommended that you use ROM BIOS routine (int 14h) or
  424.         write an AUX device driver and use IOCTL.
  425.      3) At startup, PC-DOS initializes the first auxiliary port (COM1) to 2400
  426.         baud, no parity, one stop bit, and an 8-bit word. MSDOS may differ.
  427.      4) If Ctrl-C is has been entered from STDIN, int 23h is executed.
  428.  
  429.  
  430. 04h   Auxiliary Output
  431.       Write character to STDAUX
  432. entry   AH      04h
  433.         DL      char to send to AUX
  434. return  none
  435. note 1) This function call does not return status or error codes. For greater
  436.         control it is recommended that you use ROM BIOS routine (int 14h) or
  437.         write an AUX device driver and use IOCTL.
  438.      2) If Ctrl-C is has been entered from STDIN, int 23h is executed.
  439.      3) Default is COM1 unless redirected by DOS.
  440.      4) If the device is busy, this function will wait until it is ready.
  441.  
  442.  
  443. 05h   Printer Output
  444.       Write character to STDPRN
  445. entry   AL      05h
  446.         DL      character to send
  447. return  none
  448. note 1) If Ctrl-C is has been entered from STDIN, int 23h is executed.
  449.      2) Default is PRN or LPT1 unless redirected with the MODE command.
  450.      3) If the printer is busy, this function will wait until it is ready.
  451.  
  452.  
  453. 06h   Direct Console I/O
  454.       Get character from STDIN; echo character to STDOUT
  455. entry   AH      06h
  456.         DL      0FFh for console input, or 00h-0FEh for console output
  457. return  ZF      zero flag set   (1) = no character
  458.                 zero flag clear (0) = character recieved
  459.         AL      character
  460. note 1) Extended ASCII codes require two function calls. The first call returns
  461.         00h to indicate the next call will return an extended code.
  462.      2) If DL is not 0FFh, DL is assumed to have a valid character that is
  463.         output to STDOUT.
  464.      3) This function does not check for Ctrl-C or Ctrl-PrtSc.
  465.      4) Does not echo input to screen
  466.      5) If I/O is redirected, EOF or disk full cannot be detected.
  467.  
  468.  
  469. 07h   Direct Console Input Without Echo         (does not check BREAK)
  470.       Get or wait for char at STDIN, returns char in AL
  471. entry   AH      07h
  472. return  AL      character from standard input device
  473. note 1) Extended ASCII codes require two function calls. The first call returns
  474.         00h to indicate the next call will return an extended code.
  475.      2) No checking for Ctrl-C or Ctrl-PrtSc is done.
  476.      3) Input is redirectable.
  477.  
  478.  
  479. 08h   Console Input Without Echo                (checks BREAK)
  480.       Get or Wait for char at STDIN, return char in AL
  481. entry   AH      08h
  482. return  AL      char from standard input device
  483. note 1) Char is checked for ctrl-C. If ctrl-C is detected, executes int 23h.
  484.      2) For function call 08h, extended ASCII characters require two function
  485.         calls. The first call returns 00h to signify an extended ASCII code.
  486.         The next call returns the actual code.
  487.      3) Input is redirectable. If redirected, there is no way to check EOF.
  488.  
  489.  
  490. 09h   Print String
  491.       Outputs Characters in the Print String to the STDOUT
  492. entry   AH      09h
  493.         DS:DX   pointer to the Character String to be displayed
  494. return  none
  495. note 1) The character string in memory must be terminated by a $ (24h)
  496.         The $ is not displayed.
  497.      2) Output to STDOUT is the same as function call 02h.
  498.  
  499.  
  500. 0Ah   Buffered Keyboard Input
  501.       Reads characters from STDIN and places them in the buffer beginning
  502.       at the third byte.
  503. entry   AH      0Ah
  504.         DS:DX   pointer to an input buffer
  505. return  none
  506. note 1) Min buffer size = 1, max = 255
  507.      2) Char is checked for ctrl-C. If ctrl-C is detected, executes int 23h.
  508.      3) Format of buffer DX:
  509.         byte       contents
  510.          1      Maximum number of chars the buffer will take, including CR.
  511.                 Reading STDIN and filling the buffer continues until a carriage
  512.                 return (<Enter> or 0Dh) is read. If the buffer fills to one less
  513.                 than the maximum number the buffer can hold, each additional
  514.                 number read is ignored and ASCII 7 (BEL) is output to the
  515.                 display until a carriage return is read. (you must set this
  516.                 value)
  517.          2      Actual number of characters received, excluding the carriage
  518.                 return, which is always the last character. (the function sets
  519.                 this value)
  520.          3-n    Characters received are placed into the buffer starting here.
  521.                 Buffer must be at least as long as the number in byte 1.
  522.      4) Input is redirectable. If redirected, there is no way to check EOF.
  523.      5) The string may be edited with the standard DOS editing commands as it
  524.         is being entered.
  525.      6) Extended ASCII characters are stored as 2 bytes, the first byte being
  526.         zero.
  527.  
  528.  
  529. 0Bh   Check Standard Input (STDIN) status
  530.       Checks for character availible at STDIN
  531. entry   AH      0Bh
  532. return  AL      0FFh    if a character is availible from STDIN
  533.                 00h     if no character is availible from STDIN
  534. note 1) Checks for Ctrl-C. If Ctrl-C is detected, int 23h is executed
  535.      2) Input can be redirected.
  536.      3) Checks for character only, it is not read into the application
  537.  
  538.  
  539. 0Ch   Clear Keyboard Buffer & Invoke a Keyboard Function       (FCB)
  540.       Dumps buffer, executes function in AL (01h,06h,07h,08h,0Ah only)
  541. entry   AH      0Ch
  542.         AL      function number (must be 01h, 06h, 07h, 08h, or 0Ah)
  543. return  AL      00h     buffer was flushed, no other processing performed
  544.                 other   any other value has no meaning
  545. note 1) Forces system to wait until a character is typed.
  546.      2) Flushes all typeahead input, then executes function specified by AL (by
  547.         moving it to AH and repeating the int 21 call).
  548.      3) If AL contains a value not in the list above, the keyboard buffer is
  549.         flushed and no other action is taken.
  550.  
  551.  
  552. 0Dh   Disk Reset
  553.       Flushes all currently open file buffers to disk
  554. entry   AH      0Dh
  555. return          none
  556. note 1) Does not close files. Does not update directory entries; files changed
  557.         in size but not closed are not properly recorded in the directory
  558.      2) Sets DTA address to DS:0080h
  559.      3) Should be used before a disk change, Ctrl-C handlers, and to flush
  560.         the buffers to disk.
  561.  
  562.  
  563. 0Eh   Select Disk
  564.       Sets the drive specified in DL (if valid) as the default drive
  565. entry   AL      0Eh
  566.         DL      new default drive number (0=A:,1=B:,2=C:,etc.)
  567. return  AL      total number of logical drives (not nescessarily physical)
  568. note 1) For DOS 1.x and 2.x, the minimum value for AL is 2.
  569.      2) For DOS 3.x, the minimum value for AL is 5.
  570.      3) The drive number returned is not nescessarily a valid drive.
  571.      4) For DOS 1.x: 16 logical drives are availible. A-P.
  572.         For DOS 2.x: 63 logical drives are availible. (Letters are only used for
  573.                      the first 26 drives. If more than 26 logical drives are
  574.                      used, further drive letters will be other ASCII characters
  575.                      ie {,], etc.
  576.         For DOS 3.x: 26 logical drives are availible. A-Z.
  577.  
  578.  
  579. 0Fh   Open Disk File                                                    (FCB)
  580.       Searches current directory for specified filename and opens it
  581. entry   AH      0Fh
  582.         DS:DX   pointer to an unopened FCB
  583. return  AL      00h     if file found
  584.                 0FFh    if file not not found
  585. note 1) If the drive code was 0 (default drive) it is changed to the actual
  586.         drive used (1=A:,2=B:,3=C:, etc). This allows changing the default drive
  587.         without interfering with subsequent operations on this file.
  588.      2) The current block field (FCB bytes C-D, offset 0Ch) is set to zero.
  589.      3) The size of the record to be worked with (FCB bytes E-F, offset 0Eh) is
  590.         set to the system default of 80h. The size of the file (offset 10h) and
  591.         the date (offset 14h) are set from information obtained in the root
  592.         directory. You can change the default value for the record size (FCB
  593.         bytes E-F) or set the random record size and/or current record field.
  594.         Perform these actions after the open but before any disk operations.
  595.      4) The file is opened in compatibility mode.
  596.      5) Microsoft recommends handle function call 3Dh be used instead.
  597.      6) This call is also used by the APPEND command in DOS 3.2+
  598.      7) Before performing a sequential disk operation on the file, you must
  599.         set the Current Record field (offset 20h). Before performing a random
  600.         disk operation on the file, you must set the Relative Record field
  601.         (offset 21h). If the default record size of 128 bytes is incorrect, set
  602.         it to the correct value.
  603.  
  604.  
  605. 10h  Close File                                                         (FCB)
  606.      Closes a File After a File Write
  607. entry   AH      10h
  608.         DS:DX   pointer to an opened FCB
  609. return  AL      00h     if the file is found and closed
  610.                 0FFh    if the file is not found in the current directory
  611. note 1) This function call must be done on open files that are no longer needed,
  612.         and after file writes to insure all directory information is updated.
  613.      2) If the file is not found in its correct position in the current
  614.         directory, it is assumed that the diskette was changed and AL returns
  615.         0FFh. This error return is reportedly not completely reliable with DOS
  616.         version 2.x.
  617.      3) If found, the directory is updated to reflect the status in the FCB, the
  618.         buffers to that file are flushed, and AL returns 00h.
  619.  
  620.  
  621. 11h   Search For First Matching Entry                                   (FCB)
  622.       Searches current disk & directory for first matching filename
  623. entry   AH      11h
  624.         DS:DX   pointer to address of FCB
  625. return  AL      00h     successful match
  626.                 0FFh    no matching filename found
  627. note 1) The FCB may contain the wildcard character ? under Dos 2.x, and ? or *
  628.         under 3.x.
  629.      2) The original FCB at DS:DX contains information to continue the search
  630.         with function 12h, and should not be modified.
  631.      3) If a matching filename is found, AL returns 00h and the locations at the
  632.         Disk Transfer Address are set as follows:
  633.         a) If the FCB provided for searching was an extended FCB, then the first
  634.            byte at the disk transfer address is set to 0FFh followed by 5 bytes
  635.            of zeroes, then the attribute byte from the search FCB, then the
  636.            drive number used (1=A, 2=B, etc) then the 32 bytes of the directory
  637.            entry. Thus, the disk transfer address contains a valid unopened FCB
  638.            with the same search attributes as the search FCB.
  639.         b) If the FCB provided for searching was a standard FCB, then the first
  640.            byte is set to the drive number used (1=A,2=b,etc), and the next 32
  641.            bytes contain the matching directory entry. Thus, the disk transfer
  642.            address contains a valid unopened normal FCB.
  643.      4) If an extended FCB is used, the following search pattern is used:
  644.         a) If the FCB attribute byte is zero, only normal file entries are
  645.            found. Entries for volume label, subdirectories, hidden or system
  646.            files, are not returned.
  647.         b) If the attribute byte is set for hidden or system files, or
  648.            subdirectory entries, it is to be considered as an inclusive search.
  649.            All normal file entries plus all entries matching the specified
  650.            attributes are returned. To look at all directory entries except the
  651.            volume label, the attribute byte may be set to hidden + system +
  652.            directory (all 3 bits on).
  653.         c) If the attribute field is set for the volume label, it is considered
  654.            an exclusive search, and ONLY the volume label entry is returned.
  655.      5) This call is also used by the APPEND command in DOS 3.2+
  656.  
  657.  
  658. 12h   Search For Next Entry Using FCB                                   (FCB)
  659.       Search for next matching filename
  660. entry   AH      12h
  661.         DS:DX   pointer to the unopened FCB specified from the previous Search
  662.                 First (11h) or Search Next (12h)
  663. return  AL      00h     if matching filename found
  664.                 0FFh    if matching filename was not found
  665. note 1) After a matching filename has been found using function call 11h,
  666.         function 12h may be called to find the next match to an ambiguous
  667.         request. For DOS 2.x, ?'s are allowed in the filename. For DOS 3.x,
  668.         global (*) filename characters are allowed.
  669.      2) The DTA contains info from the previous Search First or Search Next.
  670.      3) All of the FCB except for the name/extension field is used to keep
  671.         information nescessary for continuing the search, so no disk operations
  672.         may be performed with this FCB between a previous function 11h or 12h
  673.         call and this one.
  674.      4) If the file is found, an FCB is created at the DTA address and set up to
  675.         open or delete it.
  676.  
  677.  
  678. 13h   Delete File Via FCB                                               (FCB)
  679.       Deletes file specified in FCB from current directory
  680. entry   AH      13h
  681.         DS:DX   pointer to address of FCB
  682. return  AL      00h     file deleted
  683.                 0FFh    if file not found or was read-only
  684. note 1) All matching current directory entries are deleted. The global filename
  685.         character "?" is allowed in the filename.
  686.      2) Will not delete files with read-only attribute set
  687.      3) Close open files before deleting them.
  688.      4) Requires Network Access Rights
  689.  
  690.  
  691. 14h   Sequential Disk File Read                                         (FCB)
  692.       Reads record sequentially from disk via FCB
  693. entry   AH  14h
  694.         DS:DX   pointer to an opened FCB
  695. return  AL      00h     successful read
  696.                 01h     end of file (no data read)
  697.                 02h     Data Transfer Area too small for record size specified
  698.                         or segment overflow
  699.                 03h     partial record read, EOF found
  700. note 1) The record size is set to the value at offset 0Eh in the FCB.
  701.      2) The record pointed to by the Current Block (offset 0Ch) and the Current
  702.         Record (offset 20h) fields is loaded at the DTA, then the Current Block
  703.         and Current Record fields are incremented.
  704.      3) The record is read into memory at the current DTA address as specified
  705.         by the most recent call to function 1Ah. If the size of the record and
  706.         location of the DTA are such that a segment overflow or wraparound would
  707.         occur, the error return is set to AL=02h
  708.      4) If a partial record is read at the end of the file, it is passed to the
  709.         requested size with zeroes and the error return is set to AL=03h.
  710.  
  711.  
  712. 15h   Sequential Disk Write                                             (FCB)
  713.       Writes record specified by FCB sequentially to disk
  714. entry   AH      15h
  715.         DS:DX   pointer to address of FCB
  716. return  AL      00h     successful write
  717.                 01h     diskette full, write canceled
  718.                 02h     disk transfer area (DTA) too small or segment wrap
  719. note 1) The data to write is obtained from the disk transfer area
  720.      2) The record size is set to the value at offset 0Eh in the FCB.
  721.      3) This service cannot write to files set as read-only
  722.      4) The record pointed to by the Current Block (offset 0Ch) and the Current
  723.         Record (offset 20h) fields is loaded at the DTA, then the Current Block
  724.         and Current Record fields are incremented.
  725.      5) If the record size is less than a sector, the data in the DTA is written
  726.         to a buffer; the buffer is written to disk when it contains a full
  727.         sector of data, the file is closed, or a Reset Disk (function 0Dh) is
  728.         issued.
  729.      6) The record is written to disk at the current DTA address as specified
  730.         by the most recent call to function 1Ah. If the size of the record and
  731.         location of the DTA are such that a segment overflow or wraparound would
  732.         occur, the error return is set to AL=02h
  733.  
  734.  
  735. 16h   Create A Disk File                                                (FCB)
  736.       Search and open or create directory entry for file
  737. entry   AH      16h
  738.         DS:DX   pointer to an FCB
  739. return  AL      00h     successful creation
  740.                 0FFh    no room in directory
  741. note 1) If a matching directory entry is found, the file is truncated to zero
  742.         bytes.
  743.      2) If there is no matching filename, a filename is created.
  744.      3) This function calls function 0Fh (Open File) after creating or
  745.         truncating a file.
  746.      4) A hidden file can be created by using an extended FCB with the attribute
  747.         byte (offset FCB-1) set to 2.
  748.  
  749.  
  750. 17h   Rename File Specified by File Control Block (FCB)                 (FCB)
  751.       Renames file in current directory
  752. entry   AH      17h
  753.         DS:DX   pointer to an FCB (see note 4)
  754. return  AL      00h     successfully renamed
  755.                 0FFh    file not found or filename already exists
  756. note 1) This service cannot rename read-only files
  757.      2) The "?" wildcard may be used.
  758.      3) If the "?" wildcard is used in the second filename, the corresponding
  759.         letters in the filename of the directory entry are not changed.
  760.      4) The FCB must have a drive number, filename, and extension in the usual
  761.         position, and a second filename starting 6 bytes after the first, at
  762.         offset 11h.
  763.      5) The two filenames cannot have the same name.
  764.      6) FCB contains new name starting at byte 17h.
  765.  
  766.  
  767. 18h  Internal to DOS
  768.  *   Unknown
  769. entry   AH      18h
  770. return  AL      0
  771.  
  772.  
  773. 19h   Get Current Disk Drive
  774.       Return designation of current default disk drive
  775. entry   AH      19h
  776. return  AL      current default drive (0=A, 1=B,etc.)
  777. note    Some other DOS functions use 0 for default, 1=A, 2=B, etc.
  778.  
  779.  
  780. 1Ah   Set Disk Transfer Area Address (DTA)
  781.       Sets DTA address to the address specified in DS:DX
  782. entry   AH      1Ah
  783.         DS:DX   pointer to buffer
  784. return  none
  785. note 1) The default DTA is 128 bytes at offset 80h in the PSP. DOS uses the
  786.         DTA for all file I/O.
  787.      2) Registers are unchanged.
  788.      3) No error codes are returned.
  789.      2) Disk transfers cannot wrap around from the end of the segment to the
  790.         beginning or overflow into another segment.
  791.  
  792.  
  793. 1Bh   Get Current Drive File Allocation Table Information
  794.       Returns information from the FAT on the current drive
  795. entry   AH      1Bh
  796. exit    AL      number of sectors per allocation unit (cluster)
  797.         DS:BX   address of the current drive's media descriptor byte
  798.         CX      number of bytes per sector
  799.         DX      number of allocation units (clusters) for default drive
  800. note 1) Save DS before calling this function.
  801.      2) This call returned a pointer to the FAT in DOS 1.x. Beginning with
  802.         DOS 2.00, it returns a pointer only to the table's ID byte.
  803.      3) IBM recommends programmers avoid this call and use int 25h instead.
  804.  
  805.  
  806. 1Ch   Get File Allocation Table Information for Specific Device
  807.       Returns information on specified drive
  808. entry   AH      1Ch
  809.         DL      drive number (1=A, 2=B, 3=C, etc)
  810. return  AL      number of sectors per allocation unit (cluster)
  811.         DS:BX   address of media descriptor byte for drive in DL
  812.         CX      sector size in bytes
  813.         DX      number of allocation units (clusters)
  814. note 1) DL = 0 for default.
  815.      2) Save DS before calling this function.
  816.      3) Format of media-descriptor byte:
  817.         bits:   0       0   (clear)   not double sided
  818.                         1   (set)     double sided
  819.                 1       0   (clear)   not 8 sector
  820.                         1   (set)     8 sector
  821.                 2       0   (clear)   nonremovable device
  822.                         1   (set)     removable device
  823.                 3-7     always set (1)
  824.      4) This call returned a pointer to the FAT in DOS 1.x. Beginning with
  825.         DOS 2.00, it returns a pointer only to the table's ID byte.
  826.      5) IBM recommends programmers avoid this call and use int 25h instead.
  827.  
  828.  
  829. 1Dh   Not Documented by Microsoft
  830.  *    Unknown
  831. entry   AH      1Dh
  832. return  AL      0
  833.  
  834.  
  835. 1Eh   Not Documented by Microsoft
  836.  *    Unknown
  837. entry   AH      1Eh
  838. return  AL      0
  839. note    Apparently does nothing
  840.  
  841.  
  842. 1Fh Get Default Drive Parameter Block
  843.  *  Same as function call 32h (below), except that the table is accessed from
  844.     the default drive
  845. entry   AH      1Fh
  846.         other registers unknown
  847. return  AL      00h     no error
  848.                 0FFh    error
  849.         DS:BX   points to DOS Disk Parameter Block for default drive.
  850. note 1) Unknown vector returned in ES:BX.
  851.      2) For DOS 2.x and 3.x, this just invokes function 32h (undocumented,
  852.         Read DOS Disk Block) with DL=0
  853.  
  854.  
  855. 20h  Unknown
  856.  *   Internal - does nothing?
  857. entry   AH      20h
  858. return  AL      0
  859.  
  860.  
  861. 21h  Random Read from File Specified by File Control Block              (FCB)
  862.      Reads one record as specified in the FCB into the current DTA.
  863. entry   AH      21h
  864.         DS:DX   address of the opened FCB
  865. return  AL      00h     successful read operation
  866.                 01h     end of file (EOF), no data read
  867.                 02h     DTA too small for the record size specified
  868.                 03h     end of file (EOF), partial data read
  869. note 1) The current block and current record fields are set to agree with the
  870.         random record field. Then the record addressed by these fields is read
  871.         into memory at the current Disk Transfer Address.
  872.      2) The current file pointers are NOT incremented this function.
  873.      3) If the DTA is larger than the file, the file is padded to the requested
  874.         length with zeroes.
  875.  
  876.  
  877. 22h  Random Write to File Specified by FCB                              (FCB)
  878.      Writes one record as specified in the FCB to the current DTA
  879. entry   AH      22h
  880.         DS:DX   address of the opened FCB
  881. return  AL      00h     successful write operation
  882.                 01h     disk full; no data written (write was canceled)
  883.                 02h     DTA too small for the record size specified (write was
  884.                         canceled)
  885. note 1) This service cannot write to read-only files.
  886.      2) The record pointed to by the Current Block (offset 0Ch) and the Current
  887.         Record (offset 20h) fields is loaded at the DTA, then the Current Block
  888.         and Current Record fields are incremented.
  889.      3) If the record size is less than a sector, the data in the DTA is written
  890.         to a buffer; the buffer is written to disk when it contains a full
  891.         sector of data, the file is closed, or a Reset Disk (function 0Dh) is
  892.         issued.
  893.      4) The current file pointers are NOT incremented this function.
  894.      5) The record is written to disk at the current DTA address as specified
  895.         by the most recent call to function 1Ah. If the size of the record and
  896.         location of the DTA are such that a segment overflow or wraparound would
  897.         occur, the error return is set to AL=02h
  898.  
  899.  
  900. 23h  Get File Size                                                      (FCB)
  901.      Searches current subdirectory for matching file, returns size in FCB
  902. entry   AH      23h
  903.         DS:DX   address of an unopened FCB
  904. return  AL      00h file found
  905.                 0FFh file not found
  906. note 1) Record size field (offset 0Eh) must be set before invoking this function
  907.      2) The disk directory is searched for the matching entry. If a matching
  908.         entry is found, the random record field is set to the number of records
  909.         in the file. If the value of the Record Size field is not an even
  910.         divisor of the file size, the value set in the relative record field is
  911.         rounded up. This gives a returned value larger than the actual file size
  912.      3) This call is used by the APPEND command in DOS 3.2+
  913.  
  914.  
  915. 24h  Set Relative Record Field                                          (FCB)
  916.      Set random record field specified by an FCB
  917. entry   AH      24h
  918.         DS:DX   address of an opened FCB
  919. return  Random Record Field of FCB is set to be same as Current Block
  920.         and Current Record.
  921. note 1) You must invoke this function before performing random file access.
  922.      2) The relative record field of FCB (offset 21h) is set to be same as the
  923.         Current Block (offset 0Ch) and Current Record (offset 20h).
  924.      3) No error codes are returned.
  925.      4) The FCB must already be opened.
  926.  
  927.  
  928. 25h  Set Interrupt Vector
  929.      Sets the address of the code DOS is to perform each time the specified
  930.      interrupt is invoked.
  931. entry   AH      25h
  932.         AL      int number to reassign the handler to
  933.         DS:DX   address of new interrupt vector
  934. return  none
  935. note 1) Registers are unchanged.
  936.      2) No error codes are returned.
  937.      3) The interrupt vector table for the interrupt number specified in AL
  938.         is set to the address contained in DS:DX. Use function 35h (Get Vector)
  939.         to get the contents of the interrupt vector and save it for later use.
  940.      4) When you use function 25 to set an interrupt vector, DOS 3.2 doesn't
  941.         point the actual interrupt vector to what you requested. Instead, it
  942.         sets the interrupt vector to point to a routine inside DOS, which does
  943.         this:
  944.                 1. Save old stack pointer
  945.                 2. Switch to new stack pointer allocated from DOS's stack pool
  946.                 3. Call your routine
  947.                 4. Restore old stack pointer
  948.         The purpose for this was to avoid possible stack overflows when there
  949.         are a large number of active interrupts. IBM was concerned (this was an
  950.         IBM change, not Microsoft) that on a Token Ring network there would be
  951.         a lot of interrupts going on, and applications that hadn't allocated
  952.         very much stack space would get clobbered.
  953.  
  954.  
  955. 26h  Create New Program Segment Prefix (PSP)
  956.      This service copies the current program-segment prefix to a new memory
  957.      location for the creation of a new program or overlay. Once the new PSP is
  958.      in place, a DOS program can read a DOS COM or overlay file into the memory
  959.      location immediately following the new PSP and pass control to it.
  960. entry   AH      26h
  961.         DX      segment number for the new PSP
  962. return  none
  963. note 1) Microsoft recommends you use the newer DOS service 4Bh (EXEC) instead.
  964.      2) The entire 100h area at location 0 in the current PSP is copied into
  965.         location 0 of the new PSP. The memory size information at location 6
  966.         in the new segment is updated and the current termination, ctrl-break,
  967.         and critical error addresses from interrupt vector table entries for
  968.         ints 22h, 23h, and 24 are saved in the new program segment starting at
  969.         0Ah. They are restored from this area when the program terminates.
  970.      3) Current PSP is copied to specified segment
  971.  
  972.  
  973. 27h  Random Block Read From File Specified by FCB                       (FCB)
  974.      Similar to 21h (Random Read) except allows multiple files to be read.
  975. entry   AH      27h
  976.         CX      number of records to be read
  977.         DS:DX   address of an opened FCB
  978. return  AL      00h     successful read
  979.                 01h     end of file, no data read
  980.                 02h     DTA too small for record size specified (read canceled)
  981.                 03h     end of file
  982.         CX      actual number of records read (includes partial if AL=03h)
  983. note 1) The record size is specified in the FCB. The service updates the Current
  984.         Block (offset 0Ch) and Current Record (offset 20h) fields to the next
  985.         record not read.
  986.      2) If CX contained 0 on entry, this is a NOP.
  987.      3) If the DTA is larger than the file, the file is padded to the requested
  988.         length with zeroes.
  989.      4) This function assumes that the FCB record size field (0Eh) is correctly
  990.         set. If not set by the user, the default is 128 bytes.
  991.      5) The record is written to disk at the current DTA address as specified
  992.         by the most recent call to function 1Ah. If the size of the record and
  993.         location of the DTA are such that a segment overflow or wraparound would
  994.         occur, the error return is set to AL=02h
  995.  
  996.  
  997. 28h  Random Block Write to File Specified in FCB                        (FCB)
  998.      Similar to 27h (Random Write) except allows multiple files to be read.
  999. entry   AH      28h
  1000.         CX      number of records to write
  1001.         DS:DX   address of an opened FCB
  1002. return  AL      00h     successful write
  1003.                 01h     disk full, no data written
  1004.                 02h     DTA too small for record size specified (write canceled)
  1005.         CX      number of records written
  1006. note 1) The record size is specified in the FCB.
  1007.      2) This service allocates disk clusters as required.
  1008.      3) This function assumes that the FCB Record Size field (offset 0Eh) is
  1009.         correctly set. If not set by the user, the default is 128 bytes.
  1010.      4) The record size is specified in the FCB. The service updates the Current
  1011.         Block (offset 0Ch) and Current Record (offset 20h) fields to the next
  1012.         record not read.
  1013.      5) The record is written to disk at the current DTA address as specified
  1014.         by the most recent call to function 1Ah. If the size of the record and
  1015.         location of the DTA are such that a segment overflow or wraparound would
  1016.         occur, the error return is set to AL=02h
  1017.      6) If called with CX=0, no records are written, but the FCB's File Size
  1018.         entry (offset 1Ch) is set to the size specified by the FCB's Relative
  1019.         Record field (offset 21h).
  1020.  
  1021.  
  1022. 29h  Parse the Command Line for Filename                                (FCB)
  1023.      Parses a text string into the fields of a File Control Block
  1024. entry   AH      29h
  1025.         DS:SI   pointer to string to parse
  1026.         ES:DI   pointer to memory buffer to fill with unopened FCB
  1027.         AL      bit mask to control parsing
  1028.                 bit 0 = 0: parsing stops if file seperator found
  1029.                         1: causes service to scan past leading chars such as
  1030.                            blanks. Otherwise assumes the filename begins in
  1031.                            the first byte
  1032.                     1 = 0: drive number in FCB set to default (0) if string
  1033.                            contains no drive number
  1034.                         1: drive number in FCB not changed
  1035.                     2 = 0: filename in FCB set to 8 blanks if no filename in
  1036.                            string
  1037.                         1: filename in FCB not changed if string does not
  1038.                            contain a filename
  1039.                     3 = 0: extension in FCB set to 3 blanks if no extension in
  1040.                            string
  1041.                         1: extension left unchanged
  1042.                     4-7    must be zero
  1043. return  AL      00h     no wildcards in name or extension
  1044.                 01h     wildcards appeared in name or extension
  1045.                 0FFh    invalid drive specifier
  1046.         DS:SI   pointer to the first character after the parsed string
  1047.         ES:DI   pointer to the unopened FCB
  1048. note 1) If the * wildcard characters are found in the command line, this service
  1049.         will replace all subsequent chars in the FCB with question marks.
  1050.      2) This service uses the characters as filename separators
  1051.         DOS 1       : ; . , + / [ ] = " TAB SPACE
  1052.         DOS 2,3     : ; . , + = TAB SPACE
  1053.      3) This service uses the characters
  1054.         : ; . , + < > | / \ [ ] = " TAB SPACE
  1055.         or any control characters as valid filename separators
  1056.      4) A filename cannot contain a filename terminator. If one is encountered,
  1057.         all processing stops. The handle functions will allow use of some of
  1058.         these characters.
  1059.      5) If no valid filename was found on the command line, ES:DI +1 points
  1060.         to a blank (ASCII 32).
  1061.      6) This function cannot be used with filespecs which include a path
  1062.      7) Parsing is in the form D:FILENAME.EXT. If one is found, a corresponding
  1063.         unopened FCB is built at ES:DI
  1064.  
  1065.  
  1066. 2Ah  Get Date
  1067.      Returns day of the week, year, month, and date
  1068. entry   AH      2Ah
  1069. return  CX      year    (1980-2099)
  1070.         DH      month   (1-12)
  1071.         DL      day     (1-31)
  1072.         AL      weekday 00h     Sunday
  1073.                         01h     Monday
  1074.                         02h     Tuesday
  1075.                         03h     Wednesday
  1076.                         04h     Thursday
  1077.                         05h     Friday
  1078.                         06h     Saturday
  1079. note 1) Date is adjusted automatically if clock rolls over to the next day,
  1080.         and takes leap years and number of days in each month into account.
  1081.      2) Although DOS cannot set an invalid date, it can read one, such as
  1082.         1/32/80, etc.
  1083.      3) DesQview also accepts CX = 4445h and DX = 5351h, i.e. 'DESQ' as valid
  1084.      4) DOS will accept CH=0 (midnight) as a valid time, but if a file's time
  1085.         is set to exactly midnight the time will not be displayed by the DIR
  1086.         command.
  1087.  
  1088.  
  1089. 2Bh  Set Date
  1090.      set current system date
  1091. entry   AH      2Bh
  1092.         CX      year    (1980-2099)
  1093.         DH      month   (1-12)
  1094.         DL      day     (1-31)
  1095. return  AL      00h     no error (valid date)
  1096.                 0FFh    invalid date specified
  1097. note 1) On entry, CX:DX must have a valid date in the same format as returned
  1098.         by function call 2Ah
  1099.      2) DOS 3.3 also sets CMOS clock
  1100.  
  1101.  
  1102. 2Ch  Get Time
  1103.      Get current system time from CLOCK$ driver
  1104. entry   AH      2Ch
  1105. return  CH      hours   (0-23)
  1106.         CL      minutes (0-59)
  1107.         DH      seconds (0-59)
  1108.         DL      hundredths of a second (0-99)
  1109. note 1) Time is updated every 5/100 second.
  1110.      2) The date and time are in binary format
  1111.  
  1112.  
  1113. 2Dh  Set Time
  1114.      Sets current system time
  1115. entry   AH      2Dh
  1116.         CH      hours   (0-23)
  1117.         CL      minutes (0-59)
  1118.         DH      seconds (0-59)
  1119.         DL      hundredths of seconds (0-99)
  1120. return  AL      00h     if no error
  1121.                 0FFh    if bad value sent to routine
  1122. note 1) DOS 3.3 also sets CMOS clock
  1123.      2) CX and DX must contain a valid time in binary
  1124.  
  1125.  
  1126. 2Eh  Set/Reset Verify Switch
  1127.      Set verify flag
  1128. entry   AH      2Eh
  1129.         AL      00      to turn verify off (default)
  1130.                 01      to turn verify on
  1131. return  none
  1132. note 1) This is the call invoked by the DOS VERIFY command
  1133.      2) Setting of the verify switch can be obtained by calling call 54h
  1134.      3) This call is not supported on network drives
  1135.      4) DOS checks this flag each time it accesses a disk
  1136.  
  1137.  
  1138. 2Fh  Get Disk Transfer Address (DTA)
  1139.      Returns current disk transfer address used by all DOS read/write operations
  1140. entry   AH      2Fh
  1141. return  ES:BX   address of DTA
  1142. note 1) The DTA is set by function call 1Ah
  1143.      2) Default DTA address is a 128 byte buffer at offset 80h in that program's
  1144.         Program Segment Prefix
  1145.  
  1146.  
  1147. 30h  Get DOS Version Number
  1148.      Return DOS version and/or user number
  1149. entry   AH      30h
  1150. return  AH      minor version number  (i.e., DOS 2.10 returns AX = 0A02h)
  1151.         AL      major version number
  1152.         BH      OEM ID number
  1153.                 00h     IBM
  1154.                 16h     DEC
  1155.         BL:CX   24-bit user serial number
  1156. note 1) If AL returns a major version number of zero, the DOS version is
  1157.         below 1.28 for MSDOS and below 2.00 for PCDOS.
  1158.      2) IBM PC-DOS always returns 0000h in BX and CX.
  1159.  
  1160.  
  1161. 31h  Terminate Process and Stay Resident
  1162.      KEEP, or TSR
  1163. entry   AH      31h
  1164.         AL      exit code
  1165.         DX      program memory requirement in 16 byte paragraphs
  1166. return  AX      return code (retrieveable by function 4Dh)
  1167. note 1) Files opened by the application are not closed when this call is made
  1168.      2) Memory can be used more efficiently if the block containing the copy of
  1169.         the DOS environment is deallocated before terminating. This can be done
  1170.         by loading ES with the segment contained in 2Ch of the PSP and issuing
  1171.         function call 49h (Free Allocated Memory).
  1172.      3) Unlike int 27h, more than 64k may be made resident with this call
  1173.  
  1174.  
  1175. 32h  Read DOS Disk Block
  1176.  *   Retrieve the pointer to the drive parameter block for a drive
  1177. entry   AH      32h
  1178.         DL      drive (0=default, 1=A:, etc.).
  1179. return  AL      00h     if drive is valid
  1180.                 0FFh    if drive is not valid
  1181.         DS:BX   points to DOS Drive Parameter Table.  Format of block:
  1182.                 Bytes   Type        Value
  1183.                 00h     byte    Drive: 0=A:, 1=B:, etc.
  1184.                 01h     byte    Unit within drive (0, 1, 2, etc.)
  1185.                 02h-03h word    Bytes per sector
  1186.                 04h     byte    Sectors per cluster - 1
  1187.                 05h     byte    Cluster to sector shift (i.e., how far to shift-
  1188.                                 left the bytes/sector to get bytes/cluster)
  1189.                 06h-07h word    Number of reserved (boot) sectors
  1190.                 08h     byte    Number of FATs
  1191.                 09h-0Ah word    Number of root directory entries
  1192.                 0Bh-0Ch word    Sector # of 1st data. Should be same as # of
  1193.                                 sectors/track.
  1194.                 0Dh-0Eh word    # of clusters + 1 (=last cluster #)
  1195.                 0Fh     byte    Sectors for FAT
  1196.                 10h-11h word    First sector of root directory
  1197.                 12h-15h dword   Address of device driver header for this drive
  1198.                 16h     byte    Media Descriptor Byte for this drive
  1199.                 17h     byte    Zero if disk has been accessed
  1200.                 18h-1Bh dword   address of next DOS Disk Block (0FFFFh means
  1201.                                 last in chain)
  1202.                 22h     byte    Current Working Directory (2.0 only) (64 bytes)
  1203. note 1) Use [BX+0D] to find no. of clusters (>1000H, 16-bit FAT; if not, 12-bit
  1204.         (exact dividing line is probably a little below 1000h to allow for
  1205.         bad sectors, EOF markers, etc.)
  1206.      2) Short article by C.Petzold, PC Magazine  Vol.5,no.8, and the article
  1207.         "Finding Disk Parameters" in the May 1986 issue of PC Tech Journal.
  1208.      3) This call is mostly supported in OS/2 1.0's DOS Compatibility Box. The
  1209.         dword at 12h will not return the address of the next device driver when
  1210.         in the Compatibility Box.
  1211.  
  1212.  
  1213. 33h  Control-Break Check
  1214.      Get or set control-break checking at CON
  1215. entry   AH      33h
  1216.         AL      00h     to test for break checking
  1217.                 01h     to set break checking
  1218.                         DL      00h     to disable break checking
  1219.                                 01h     to enable break checking
  1220.                 02h     internal, called by PRINT.COM (DOS 3.1)
  1221. return  DL      00h     if break=off
  1222.                 01h     if break=on
  1223.         AL      0FFh    error
  1224.  
  1225.  
  1226. 34h  Return INDOS Flag
  1227.  *   Returns ES:BX pointing to Critical Section Flag, byte indicating whether
  1228.      it is safe to interrupt DOS.
  1229. entry   AH      34h
  1230. return  ES:BX   points to DOS "critical section flag"
  1231. note 1) If byte is 0, it is safe to interrupt DOS. This was mentioned in some
  1232.         documentation by Microsoft on a TSR standard, and PC Magazine reports
  1233.         it functions reliably under DOS versions 2.0 through 3.3. Chris
  1234.         Dunford (of CED fame) and a number of anonymous messages on the BBSs
  1235.         indicate it may not be totally reliable.
  1236.      2) The byte at ES:BX+1 is used by the Print program for this same purpose,
  1237.         so it's probably safer to check the WORD at ES:BX.
  1238.      3) Reportedly, examination of DOS 2.10 code in this area indicates that the
  1239.         byte immediately following this "critical section flag" must be 00h to
  1240.         permit the PRINT.COM interrupt to be called. For DOS 3.0 and 3.1 (except
  1241.         Compaq DOS 3.0), the byte before the "critical section flag" must be
  1242.         zero; for Compaq DOS 3.0, the byte 01AAh before it must be zero.
  1243.      4) In DOS 3.10 this reportedly changed to word value, with preceding byte.
  1244.      5) This call is supported in OS/2 1.0's DOS Compatibility Box
  1245.      6) Gordon Letwin of Microsoft discussed this call on ARPAnet in 1984. He
  1246.         stated:
  1247.         a) this is not supported under any version of the DOS
  1248.         b) it usually works under DOS 2, but there may be circumstances
  1249.            when it doesn't (general disclaimer, don't know of a specific
  1250.            circumstance)
  1251.         c) it will usually not work under DOS 3 and DOS 3.1; the DOS is
  1252.            considerably restructured and this flag takes on additional
  1253.            meanings and uses
  1254.         d) it will fail catastrophically under DOS 4.0 and forward.
  1255.         Obviously this information is incorrect since the call works fine
  1256.         through DOS 3.3. Microsoft glasnost?
  1257.  
  1258.  
  1259. 35h  Get Vector
  1260.      Get interrupt vector
  1261. entry   AH      35h
  1262.         AL      interrupt number (hexadecimal)
  1263. return  ES:BX   address of interrupt vector
  1264. note    Use function call 25h to set the interrupt vectors
  1265.  
  1266.  
  1267. 36h  Get Disk Free Space
  1268.      get information on specified drive
  1269. entry   AH      36h
  1270.         DL      drive number (0=default, 1=A:, 2=B:, etc)
  1271. return  AX      number of sectors per cluster
  1272.                 0FFFFh means drive specified in DL is invalid
  1273.         BX      number of availible clusters
  1274.         CX      bytes per sector
  1275.         DX      clusters per drive
  1276. note 1) Mult AX * CX * BX for free space on disk
  1277.      2) Mult AX * CX * DX for total disk space
  1278.      3) Function 36h returns an incorrect value after an ASSIGN command. Prior
  1279.         to ASSIGN, the DX register contains 0943h on return, which is the free
  1280.         space in clusters on the HC diskette. After ASSIGN, even with no
  1281.         parameters, 0901h is returned in the DX register; this is an incorrect
  1282.         value. Similar results occur with DD diskettes on a PC-XT or a PC-AT.
  1283.         This occurs only when the disk is not the default drive. Results are as
  1284.         expected when the drive is the default drive. Therefore, the
  1285.         circumvention is to make the desired drive the default drive prior to
  1286.         issuing this function call.
  1287.      4) Int 21h, function call 36h returns an incorrect value after an ASSIGN
  1288.         command. Prior to ASSIGN, the DX register contains 0943h on return,
  1289.         which is the free space in clusters on the HC diskette. After ASSIGN,
  1290.         even with no parameters, 0901h is returned in the DX register; this is
  1291.         an incorrect value. Similar results occur with DD diskettes on a PC-XT
  1292.         or a PC-AT. This occurs only when the disk is not the default drive.
  1293.         Results are as expected when the drive is the default drive. Therefore,
  1294.         the circumvention is to make the desired drive the default drive prior
  1295.         to issuing this function call.
  1296.      5) This function supercedes functions 1Bh and 1Ch.
  1297.  
  1298.  
  1299. 37h  SWITCHAR / AVAILDEV
  1300.  *   Get/set option marking character (is usually "/"), and device type
  1301. entry   AH      37h
  1302.         AL      00h     read switch character (returns current character in DL)
  1303.                 01h     set character in DL as new switch character
  1304.       (DOS 2.x) 02h     read device availability (as set by function AL=3) into
  1305.                         DL. A 0 means devices that devices must be accessed in
  1306.                         file I/O calls by /dev/device. A non-zero value means
  1307.                         that devices are accessible at every level of the
  1308.                         directory tree (e.g., PRN is the printer and not a file
  1309.                         PRN).
  1310.                         AL=2 to return flag in DL, AL=3 to set from DL (0 = set,
  1311.                         1 = not set).
  1312.       (DOS 2.x) 03h     get device availability, where:
  1313.         DL      00h     means /dev/ must precede device names
  1314.                 01h     means /dev/ need not precede device names
  1315. return  DL      switch character (if AL=0 or 1)
  1316.                 device availability flag (if AL=2 or 3)
  1317.         AL      0FFh    the value in AL was not in the range 0-3.
  1318. note 1) Functions 2 & 3 appear not to be implemented for DOS 3.x.
  1319.      2) It is documented on page 4.324 of the MS-DOS (version 2) Programmer's
  1320.         Utility Pack (Microsoft - published by Zenith).
  1321.      3) Works on all versions of IBM PC-DOS from 2.0 through 3.3.1.
  1322.      4) The SWITCHAR is the character used for "switches" in DOS command
  1323.         arguments (defaults to '/', as in "DIR/P"). '-' is popular to make a
  1324.         system look more like UNIX; if the SWITCHAR is anything other than '/',
  1325.         then '/' may be used instead of '\' for pathnames
  1326.      5) Ignored by XCOPY, PKARC, LIST
  1327.      6) SWITCHAR may not be set to any character used in a filename
  1328.      7) In DOS 3.x you can still read the "AVAILDEV" byte with subfunction 02h
  1329.         but it always returns 0FFh even if you try to change it to 0 with
  1330.         subfunction 03h.
  1331.      8) AVAILDEV=0 means that devices must be referenced in an imaginary
  1332.         subdirectory "\dev" (similar to UNIX's /dev/*); a filename "PRN.DAT"
  1333.         can be created on disk and manipulated like any other. If AVAILDEV != 0
  1334.         then device names are recognized anywhere (this is the default):
  1335.         "PRN.DAT" is synonymous with "PRN:".
  1336.      9) These functions reportedly are not supported in the same fashion in
  1337.         various implementations of DOS.
  1338.  
  1339.  
  1340. 38h  Return Country Dependent Information   (PCDOS 2.0, 2.1, MSDOS 2.00 only)
  1341.      get country-dependent information
  1342. entry   AH      38h
  1343.         AL      function code  (must be 0 in DOS 2.x)
  1344.         DS:DX   pointer to 32 byte memory area
  1345. return  AX      error code if CF set
  1346.         DS:DX   country data if CF not set
  1347.                 word    date/time format
  1348.                         0 = USA standard       H:M:S   M/D/Y
  1349.                         1 = European standard  H:M:S   D/M/Y
  1350.                         2 = Japanese standard  H:M:S   D:M:Y
  1351.                 byte    ASCIIZ string currency symbol followed by byte of zeroes
  1352.                 byte    ASCIIZ string thousands separator followed by byte of
  1353.                         zeroes
  1354.                 byte    ASCIIZ string decimal separator followed by byte of
  1355.                         zeroes
  1356.              24 bytes   reserved
  1357.  
  1358.  
  1359. 38h  Get Country Dependent Information    (PCDOS 3.x+, MSDOS 2.01+)
  1360.      get country-dependent information
  1361. entry   AH      38h
  1362.         AL      function code
  1363.                 00h     to get current country information
  1364.                 code    country code to get information for, for countries
  1365.                         with codes less than 255
  1366.                 0FFh    to get country information for countries with a code
  1367.                         greater than 255
  1368.         BX      16 bit country code if AL=0FFh
  1369.         DS:DX   pointer to the memory buffer where the data will be returned
  1370. return  CF      0 (clear) function completed
  1371.                 1 (set) error
  1372.                    AX   error code if CF set
  1373.                         2  invalid country code (no table for it)
  1374.         BX      country code (usually international telephone code)
  1375.         DS:DX   country data if CF not set
  1376.                 word    date/time format
  1377.                         0 = USA standard       H:M:S   M/D/Y
  1378.                         1 = European standard  H:M:S   D/M/Y
  1379.                         2 = Japanese standard  H:M:S   D:M:Y
  1380.               5 bytes   currency symbol null terminated
  1381.               2 bytes   thousands separator null terminated
  1382.               2 bytes   decimal separator null terminated
  1383.               2 bytes   date separator null terminated
  1384.               2 bytes   time separator null terminated
  1385.                 byte    bit field currency format
  1386.                         bit 0 = 0  if currency symbol precedes the value
  1387.                                 1  if currency symbol is after the value
  1388.                         bit 1 = 0  no spaces between value and currency symbol
  1389.                                 1  one space between value and currency symbol
  1390.                         bits 2-7   not defined by Microsoft
  1391.                 byte    number of significant decimal digits in currency
  1392.                         (number of places to right of decimal point)
  1393.                 byte    time format
  1394.                         bit 0 = 0  12 hour clock
  1395.                         bit 0 = 1  24 hour clock
  1396.               2 words   case map call address
  1397.                         entry   AL  ASCII code of character to be converted to
  1398.                                     uppercase
  1399.                         return  AL  ASCII code of the uppercase input character
  1400.               2 bytes   data list separator null terminated
  1401.               5 words   reserved
  1402. note 1) When an alternate keyboard handler is invoked, the keyboard routine is
  1403.         loaded into user memory starting at the lowest portion of availible
  1404.         user memory. The BIOS interrupt vector that services the keyboard is
  1405.         redirected to the memory area where the new routine resides. Each new
  1406.         routine takes up about 1.6K of memory and has lookup tables that return
  1407.         values unique to each language. (KEYBxx in the DOS book)
  1408.          Once the keyboard interrupt vector is changed by the DOS keyboard
  1409.         routine, the new routine services all calls unless the system is
  1410.         returned to the US format by the ctrl-alt-F1 keystroke combination. This
  1411.         does not change the interrupt vector back to the BIOS location; it
  1412.         merely passes the table lookup to the ROM locations.
  1413.      2) Ctrl-Alt-F1 will only change systems with US ROMS to the US layout.
  1414.         Some systems are delivered with non-US keyboard handler routines in ROM
  1415.      3) Case mapping call: the segment/offset of a FAR procedure that performs
  1416.         country-specific lower-to-upper case mapping on ASCII characters 80h to
  1417.         0FFh. It is called with the character to be mapped in AL. If there is
  1418.         an uppercase code for the letter, it is returned in AL, if there is no
  1419.         code or the function was called with a value of less than 80h AL is
  1420.         returned unchanged.
  1421.  
  1422.  
  1423. 38h  Set Country Dependent Information
  1424.      set country-dependent information
  1425. entry   AH      38h
  1426.         AL      code    country code to set information for, for countries
  1427.                         with codes less than 255
  1428.                 0FFh    to set country information for countries with a code
  1429.                         greater than 255
  1430.         BX      16 bit country code if AL=0FFh
  1431.         DX      0FFFFh
  1432. return  CF      clear   successful
  1433.                 set     if error
  1434.                         AX      error code if CF flag set
  1435.  
  1436.  
  1437. 39h  Create Subdirectory (MKDIR)
  1438.      Makes a subdirectory along the indicated path
  1439. entry   AH      39h
  1440.         DS:DX   address of ASCIIZ pathname string
  1441. return  flag CF 0       successful
  1442.                 1       error
  1443.                         AX      error code if any  (3, 5)
  1444. note 1) The ASCIIZ string may contain drive and subdirectory.
  1445.      2) Drive may be any valid drive (not nescessarily current drive)
  1446.      3) The pathname cannot exceed 64 characters
  1447.  
  1448.  
  1449. 3Ah  Remove Subdirectory  (RMDIR)
  1450.      remove a directory entry
  1451. entry   AH      3Ah
  1452.         DS:DX   address of ASCIIZ pathname string
  1453. return  CF      clear     successful
  1454.                 set       AX      error code if any  (3, 5, 16)
  1455. note 1) The ASCIIZ string may contain drive and subdirectory.
  1456.      2) Drive may be any valid drive (not nescessarily current drive)
  1457.      3) The pathname cannot exceed 64 characters
  1458.  
  1459.  
  1460. 3Bh  Change Current Directory
  1461.      (CHDIR)
  1462. entry   AH      3Bh
  1463.         DS:DX   address of ASCIIZ string
  1464. return  flag CF 0       successful
  1465.                 1       error
  1466.         AX      error code if any (3)
  1467. note 1) The pathname cannot exceed 64 characters
  1468.      2) The ASCIIZ string may contain drive and subdirectory.
  1469.      3) Drive may be any valid drive (not nescessarily current drive)
  1470.  
  1471.  
  1472. 3Ch  Create A File (CREAT)
  1473.      create a file with handle
  1474. entry   AH      3Ch
  1475.         CX      attributes for file
  1476.                 00h     normal
  1477.                 01h     read only
  1478.                 02h     hidden
  1479.                 03h     system
  1480.         DS:DX   address of ASCIIZ filename string
  1481. return  flag CF 0       successful creation
  1482.                 1       error
  1483.         AX      16 bit file handle
  1484.                 or error code  (3, 4, 5)
  1485. note 1) The ASCIIZ string may contain drive and subdirectory.
  1486.      2) Drive may be any valid drive (not nescessarily current drive)
  1487.      3) If the volume label or subdirectory bits are set in CX, they are ignored
  1488.      4) The file is opened in read/write mode
  1489.      5) If the file does not exist, it is created. If one of the same name
  1490.         exists, it is truncated to a length of 0.
  1491.  
  1492.  
  1493. 3Dh  Open A File
  1494.      Open disk file with handle
  1495. entry   AH      3Dh
  1496.         AL      access code byte
  1497. (DOS 2.x)       bits 0-2  file attribute
  1498.                 000     read only
  1499.                 001     write only
  1500.                 010     read/write
  1501.                 bits 3-7 should be set to zero
  1502. (DOS 3.x)       bits 0-2  file attribute
  1503.                 000     read only
  1504.                 001     write only
  1505.                 010     read/write
  1506.                 bit 3   reserved
  1507.                 0       should be set to zero
  1508.                 bits 4-6 sharing mode (network)
  1509.                 000     compatibility mode (the way FCBs open files)
  1510.                 001     read/write access denied (exclusive)
  1511.                 010     write access denied
  1512.                 011     read access denied
  1513.                 100     full access permitted
  1514.                 bit 7   inheritance flag
  1515.                 0       file inherited by child process
  1516.                 1       file private to child process
  1517.         DS:DX   address of ASCIIZ pathname string
  1518. return  flag CF set on error
  1519.                 AX      error code
  1520.                 1       error
  1521.         AX      16 bit file handle
  1522.                 or error code (1, 2, 4, 5, 0Ch)
  1523. note 1) Opens any normal, system, or hidden file
  1524.      2) Files that end in a colon are not opened
  1525.      3) The rear/write pointer is set at the first byte of the file and the
  1526.         record size of the file is 1 byte (the read/write pointer can be changed
  1527.         through function call 42h). The returned file handle must be used for
  1528.         all subsequent input and output to the file.
  1529.      4) If the file handle was inherited from a parent process or was
  1530.         duplicated by DUP or FORCEDUP, all sharing and access restrictions are
  1531.         also inherited.
  1532.      5) A file sharing error (error 1) causes an int 24h to execute with an
  1533.         error code of 2
  1534.  
  1535.  
  1536. 3Eh  Close A File Handle
  1537.      Close a file and release handle for reuse
  1538. entry   AH      3Eh
  1539.         BX      file handle
  1540. return  flag CF 0       successful close
  1541.                 1       error
  1542.         AX      error code if error (6)
  1543. note 1) When executed, the file is closed, the directory is updated, and all
  1544.         buffers for that file are flushed. If the file was changed, the time
  1545.         and date stamps are changed to current
  1546.      2) If called with the handle 00000, it will close STDIN (normally the
  1547.         keyboard).
  1548.  
  1549.  
  1550. 3Fh  Read From A File Or Device
  1551.      Read from file with handle
  1552. entry   AH      3Fh
  1553.         BX      file handle
  1554.         CX      number of bytes to read
  1555.         DS:DX   address of buffer
  1556. return  flag CF 0       successful read
  1557.                 1       error
  1558.         AX      0       pointer was already at end of file
  1559.                         or number of bytes read
  1560.                         or error code (5, 6)
  1561. note 1) This function attempts to transfer the number of bytes specified in CX
  1562.         to a buffer location. It is not guaranteed that all bytes will be read.
  1563.         If AX < CX a partial record was read.
  1564.      2) If performed from STDIN (file handle 0000), the input can be redirected
  1565.      3) If used to read the keyboard, it will only read to the first CR
  1566.      4) The file pointer is incremented to the last byte read.
  1567.  
  1568.  
  1569. 40h  Write To A File Or Device
  1570.      Write to file with handle
  1571. entry   AH      40h
  1572.         BX      file handle
  1573.         CX      number of bytes to write
  1574.         DS:DX   address of buffer
  1575. return  flag CF 0       successful write
  1576.                 1       error
  1577.         AX      number of bytes written
  1578.                 or error code  (5, 6)
  1579. note 1) This call attempts to transfer the number of bytes indicated in CX
  1580.         from a buffer to a file. If CX and AX do not match after the write,
  1581.         an error has taken place; however no error code will be returned for
  1582.         this problem. This is usually caused by a full disk.
  1583.      2) If the write is performed to STDOUT (handle 0001), it may be redirected
  1584.      3) To truncate the file at the current position of the file pointer, set
  1585.         the number of bytes in CX to zero before calling int 21h. The pointer
  1586.         can be moved to any desired position with function 42h.
  1587.      4) This function will not write to a file or device marked read-only.
  1588.  
  1589.  
  1590. 41h  Delete A File From A Specified Subdirectory
  1591.      (UNLINK)
  1592. entry   AH      41h
  1593.         DS:DX   pointer to ASCIIZ filespec to delete
  1594. return  CF      0       successful
  1595.                 1       error
  1596.                 AX      error code if any  (2, 5)
  1597. note 1) This function will not work on a file marked read-only
  1598.      2) Wildcards are not accepted
  1599.  
  1600.  
  1601. 42h  Move a File Read/Write Pointer
  1602.      (LSEEK)
  1603. entry   AH      42h
  1604.         AL      method code
  1605.                 00h     offset from beginning of file
  1606.                 01h     offset from present location
  1607.                 02h     offset from end of file
  1608.         BX      file handle
  1609.         CX      most significant half of offset
  1610.         DX      least significant half of offset
  1611. return  AX      low offset of new file pointer
  1612.         DX      high offset of new file pointer
  1613.         CF      0       successful move
  1614.                 1       error
  1615.                 AX      error code (1, 6)
  1616. note 1) If pointer is at end of file, reflects file size in bytes.
  1617.      2) The value in DX:AX is the absolute 32 bit byte offset from the beginning
  1618.         of the file
  1619.  
  1620.  
  1621. 43h  Get/Set file attributes
  1622.      (CHMOD)
  1623. entry   AH      43h
  1624.         AL      00h     get file attributes
  1625.                 01h     set file attributes
  1626.                 CX      file attributes to set
  1627.                         bit 0       read only
  1628.                         1       hidden file
  1629.                         2       system file
  1630.                         3       volume label
  1631.                         4       subdirectory
  1632.                         5       written since backup
  1633.         DS:DX   pointer to full ASCIIZ file name
  1634. return  CF      set if error
  1635.         AX      error code  (1, 2, 3, 5)
  1636.         CX      file attributes on get
  1637.                 attributes:
  1638.                 01h     read only
  1639.                 02h     hidden
  1640.                 04h     system
  1641.                 0FFh    archive
  1642.  
  1643.  
  1644. 44h  I/O Control for Devices (IOCTL)
  1645.      Get or set device information
  1646. entry   AH      44h
  1647.         AL      00h     get device information (from DX)
  1648.                         BX      file or device handle
  1649.                         return  DX      device info
  1650.                                         If bit 7 set: (character device)
  1651.                                            bit 0: console input device
  1652.                                                1: console output device
  1653.                                                2: NUL device
  1654.                                                3: CLOCK$ device
  1655.                                                4: device is special
  1656.                                                5: binary (raw) mode
  1657.                                                6: Not EOF
  1658.                                               12: network device (DOS 3.x)
  1659.                                               14: can process IOCTL control
  1660.                                                   strings (func 2-5)
  1661.                                          If bit 7 clear: (file)
  1662.                                          bits 0-5 are block device number
  1663.                                                 6: file has not been written
  1664.                                                12: Network device (DOS 3.x)
  1665.                                             15: file is remote (DOS 3.x)
  1666.                 01h     set device information (DH must be zero for this call)
  1667.                         DX bits:
  1668.                         0    1  console input device
  1669.                         1    1  console output device
  1670.                         2    1  null device
  1671.                         3    1  clock device
  1672.                         4    1  reserved
  1673.                         5    0  binary mode - don't check for control chars
  1674.                              1  cooked mode - check for control chars
  1675.                         6    0  EOF - End Of File on input
  1676.                         7       device is character device if set, if not, EOF
  1677.                                 is 0 if channel has been written, bits 0-5 are
  1678.                                 block device number
  1679.                         12      network device
  1680.                         14   1  can process control strings (AL 2-5, can only be
  1681.                                 read, cannot be set)
  1682.                         15   n  reserved
  1683.                 02h     read CX bytes to device in DS:DX from BX control chan
  1684.                 03h     Write Device Control String
  1685.                         BX      device handle
  1686.                         CX      number of bytes to write
  1687.                         DS:DX   pointer to buffer
  1688.                         return  AX      number of bytes written
  1689.                 04h     read from block device (drive number in BL)
  1690.                         BL      drive number (0=default)
  1691.                         CX      number of bytes to read
  1692.                         DS:DX   pointer to buffer
  1693.                         return  AX      number of bytes read
  1694.  
  1695.                 05h     write to block device  (drive number in BL)
  1696.                         AX      number of bytes transfered
  1697.                 06h     get input handle status
  1698.                 07h     get output handle status
  1699.                         AX      0FFh    for ready
  1700.                                 00h     for not ready
  1701.                 08h     removable media bit (DOS 3.x)
  1702.                         return  AX      00h     device is removable
  1703.                                         01h     device is nonremovable
  1704.                                         0Fh     invalid drive specification
  1705.                 09h     test local or network device in BL (DOS 3.x)
  1706.                         BL      drive number (0=default)
  1707.                         return  DX      attribute word, bit 12 set if device is
  1708.                                         remote
  1709.                 0Ah     is handle in BX local or remote? (DOS 3.x)
  1710.                         BX     file handle
  1711.                         return DX (attribute word) bit 15 set if file is remote
  1712.                 0Bh     change sharing retry count to DX (default=3), (DOS 3.x)
  1713.                         CX     delay (default 1)
  1714.                         DX     retry count (default 3)
  1715.                 0Ch     general IOCTL (DOS 3.3 [3.2?]) allows a device driver to
  1716.                         prepare, select, refresh, and query Code Pages
  1717.                 0Dh     Block Device Request (DOS 3.3+)
  1718.                         BL      drive number (0=default)
  1719.                         CH      major subfunction
  1720.                         CL      minor subfunction
  1721.                                 40h set device parameters
  1722.                                 41h write logical device track
  1723.                                 42h format and verify logical device track
  1724.                                 60h get device parameters
  1725.                                 61h read logical device track
  1726.                                 62h verify logical device track
  1727.                         DS:DX   pointer to parameter block
  1728.                 0Eh     GET LOGICAL DEVICE (DOS 3.3+)
  1729.                         BL      drive number (0=default)
  1730.                         return  AL=0 block device has only one logical drive
  1731.                                 assigned 1..n the last letter used to reference
  1732.                                 the device (1=A:,etc)
  1733.                 0Fh     Set Logical Device (DOS 3.3+)
  1734.         BL      drive number:  0=default, 1=A:, 2=B:, etc.
  1735.         BX      file handle
  1736.         CX      number of bytes to read or write
  1737.         DS:DX   data or buffer
  1738.         DX      data
  1739. return  AX      number of bytes transferred
  1740.                 or error code (call function 59h for extended error codes)
  1741.                 or status
  1742.                         00h     not ready
  1743.                         0FFh    ready
  1744.         CF      set if error
  1745.  
  1746.  
  1747. 45h  Duplicate a File Handle (DUP)
  1748.      Create duplicate handle
  1749. entry   AH      45h
  1750.         BX      file handle to duplicate
  1751. return  CF      clear   AX      duplicate handle
  1752.                 set     AX      error code  (4, 6)
  1753. note 1) If you move the pointed of one handle, the pointer of the other will
  1754.         also be moved.
  1755.      2) The handle in BX must be open
  1756.  
  1757.  
  1758. 46h  Force Duplicate of a Handle (FORCEDUP or CDUP)
  1759.      forces handle in CX to refer to the same file at the same position as BX
  1760. entry   AH      46h
  1761.         BX      existing file handle
  1762.         CX      new file handle
  1763. return  CF      clear   both handles now refer to existing file
  1764.                 set     error
  1765.                 AX      error code (4, 6)
  1766. note 1) If CX was an open file, it is closed first
  1767.      2) If you move the read/write pointer of either file, both will move
  1768.      3) The handle in BX must be open
  1769.  
  1770.  
  1771. 47h  Get Current Directory
  1772.      places full pathname of current directory/drive into a buffer
  1773. entry   AH      47h
  1774.         DL      drive (0=default, 1=A:, etc.)
  1775.         DS:SI   points to 64-byte buffer area
  1776. return  CF      clear   DS:DI   pointer to ASCIIZ pathname of current directory
  1777.                 set     AX      error code (0Fh)
  1778. note   String does not begin with a drive identifier or a backslash
  1779.  
  1780.  
  1781. 48h  Allocate Memory
  1782.      allocates requested number of 16-byte paragraphs of memory
  1783. entry   AH      48h
  1784.         BX      number of 16-byte paragraphs desired
  1785. return  CF      clear   AX      segment address of allocated space
  1786.                         BX      maximum number paragraphs available
  1787.                 set     AX      error code (7, 8)
  1788. note    BX indicates maximum memory availible only if allocation fails
  1789.  
  1790.  
  1791. 49h  Free Allocated Memory
  1792.      frees specified memory blocks
  1793. entry   AH      49h
  1794.         ES      segment address of area to be freed
  1795. return  CF      clear   successful
  1796.                 set     AX      error code (7, 9)
  1797. note 1) This call is only valid when freeing memory obtained by function 48h.
  1798.      2) A program should not try to release memory not belonging to it.
  1799.  
  1800.  
  1801. 4Ah  Modify Allocated Memory Blocks (SETBLOCK)
  1802.      expand or shrink memory for a program
  1803. entry   AH      4AH
  1804.         BX      new size in 16 byte paragraphs
  1805.         ES      segment address of block to change
  1806. return  CF      clear   nothing
  1807.                 set     AX      error code (7, 8, 9)
  1808.                     or  BX      max number paragraphs available
  1809. note 1) Max number paragraphs availible is returned only if the call fails
  1810.      2) Memory can be expanded only if there is memory availible
  1811.  
  1812.  
  1813. 4Bh  Load or Execute a Program
  1814.      (EXEC)
  1815. entry   AH      4Bh
  1816.         AL      00h     load and execute program. A PSP is built for the program
  1817.                         the ctrl-break and terminate addresses are set to the
  1818.                         new PSP.
  1819.                *01h     load but don't execute  (note 1)
  1820.                *02h     load (internal) but do not execute
  1821.                 03h     load overlay (do not create PSP, do not begin execution)
  1822.         DS:DX   points to the ASCIIZ string with the drive, path, and filename
  1823.                 to be loaded
  1824.         ES:BX   points to a parameter block for the load
  1825.                (AL=00h) word    segment address of environment string to be
  1826.                                 passed
  1827.                         dword   pointer to the command line to be placed at
  1828.                                 PSP+80h
  1829.                         dword   pointer to default FCB to be passed at PSP+5Ch
  1830.                         dword   pointer to default FCB to be passed at PSP+5Ch
  1831.                (AL=03h) word    segment address where file will be loaded
  1832.                         word    relocation factor to be applied to the image
  1833. return  CF      clear   successful
  1834.                 set     error
  1835.                 AX      error code (1, 2, 8, 0Ah, 0Bh)
  1836. note 1) If you make this call with AL=1 the program will be loaded as if you
  1837.         made the call with AL=0 except that the program will not be executed.
  1838.         Additionally, with AL=1 the stack segment and pointer along with the
  1839.         program's CS:IP entry point are returned to the program which made the
  1840.         4B01h call. These values are put in the four words at ES:BX+0eh. On
  1841.         entry to the call ES:BX points to the environment address, the command
  1842.         line and the two default FCBs. This form of EXEC is used by DEBUG.COM.
  1843.      2) Application programs may invoke a secondary copy of the command
  1844.         processor (normally COMMAND.COM) by using the EXEC function.  Your
  1845.         program may pass a DOS command as a parameter that the secondary
  1846.         command processor will execute as though it had been entered from the
  1847.         standard input device.
  1848.         The procedure is:
  1849.          A. Assure that adequate free memory (17k for 2.x and 3.0, 23k for 3.1
  1850.             up) exists to contain the second copy of the command processor and
  1851.             the command it is to execute. This is accomplished by executing
  1852.             function call 4Ah to shrink memory allocated to that of your current
  1853.             requirements. Next, execute function call 48h with BX=0FFFFh. This
  1854.             returns the amount of memory availible.
  1855.         B. Build a parameter string for the secondary command processor in the
  1856.            form:
  1857.                          1 byte   length of parameter string
  1858.                         xx bytes  parameter string
  1859.                          1 byte   0Dh (carriage return)
  1860.            For example, the assembly language statement below would build the
  1861.            string to cause execution of the command FOO.EXE:
  1862.                               DB 19, "/C C:FOO" , 13
  1863.         C. Use the EXEC function call (4Bh), function value 0 to cause execution
  1864.            of the secondary copy of the command processor. (The drive,
  1865.            directory, and name of the command processor can be gotten from the
  1866.            COMSPEC variable in the DOS environment passed to you at PSP+2Ch.)
  1867.         D. Remember to set offset 2 of the EXEC control block to point to the
  1868.            string built above.
  1869.      3) All open files of a process are duplicated in the newly created
  1870.         process after an EXEC, except for files originally opened with the
  1871.         inheritance bit set to 1.
  1872.      4) The environment is a copy of the original command processor's
  1873.         environment. Changes to the EXECed environment are not passed back to
  1874.         the original. The environment is followed by a copy of the DS:DX
  1875.         filename passed to the child process. A zero value will cause the
  1876.         child process to inherit the environment of the calling process. The
  1877.         segment address of the environment is placed at offset 2Ch of the
  1878.         PSP of the program being invoked.
  1879.      5) This function uses the same resident part of COMMAND.COM, but makes a
  1880.         duplicate of the transient part.
  1881.      6) How EXEC knows where to return to:  Basically the vector for int 22h
  1882.         holds the terminate address for the current process.  When a process
  1883.         gets started, the previous contents of int 22h get tucked away in the
  1884.         PSP for that process, then int 22h gets modified.  So if Process A
  1885.         EXECs process B, while Process B is running, the vector for int 22h
  1886.         holds the address to return to in Process A, while the save location in
  1887.         Process B's PSP holds the address that process A will return to when
  1888.         *it* terminates.  When Process B terminates by one of the usual legal
  1889.         means, the contents of int 22h are (surmising) shoved onto the stack,
  1890.         the old terminate vector contents are copied back to int 22h vector from
  1891.         Process B's PSP, then a RETF or equivalent is executed to return control
  1892.         to process A.
  1893.  
  1894.  
  1895. 4Ch  Terminate a Process (EXIT)
  1896.      Quit with exit code
  1897. entry   AH      4Ch
  1898.         AL      exit code in AL when called, if any, is passed to next process
  1899. return  none
  1900. note 1) Control passes to DOS or calling program
  1901.      2) return code from AL can be retrieved by ERRORLEVEL or function 4Dh
  1902.      3) all files opened by this process are closed, buffers are flushed, and
  1903.         the disk directory is updated
  1904.      4) Restores Terminate vector from PSP:000Ah
  1905.                  Ctrl-C vector from PSP:000Eh
  1906.                  Critical Error vector from PSP:0012h
  1907.  
  1908.  
  1909. 4Dh  Get Return Code of a Subprocess (WAIT)
  1910.      gets return code from functions 31h and 4Dh  (ERRORLEVEL)
  1911. entry   AH      4Dh
  1912. return  AL      exit code of subprogram (functions 31h or 4Ch)
  1913.         AH      circumstance which caused termination
  1914.                 00h     normal termination
  1915.                 01h     control-break
  1916.                 02h     critical device error
  1917.                 03h     terminate and stay resident (function 31h)
  1918. note    The exit code is only returned once
  1919.  
  1920.  
  1921. 4Eh  Find First Matching File (FIND FIRST)
  1922.      Find first ASCIIZ
  1923. entry   AH      4Eh
  1924.         CX      search attributes
  1925.         DS:DX   pointer to ASCIIZ filename (with attributes)
  1926. return  CF      set     AX      error code (2, 12h)
  1927.                 clear   data block written at current DTA
  1928.                         format of block is:
  1929.   documented by Micro-  |00h   1 byte   attribute byte of search
  1930.   soft as "reserved for |01h   1 byte   drive used in search
  1931.   DOS' use on subsquent |02h   11 bytes the search name used
  1932.   Find Next calls"      |0Ch   2 bytes  word value of last entry
  1933.   function 4Fh          |0Fh   4 bytes  dword pointer to this DTA
  1934.                         |13h   2 bytes  word directory start
  1935.                          15h   1 byte   file attribute
  1936.                          16h   2 bytes  file time
  1937.                          18h   2 bytes  file date
  1938.                          1Ah   2 bytes  low word of file size
  1939.                          1Ch   2 bytes  high word of file size
  1940.                          1Eh  13 bytes  name and extension of file found, plus
  1941.                                         1 byte of 0s. All blanks are removed
  1942.                                         from the name and extension, and if an
  1943.                                         extension is present it is preceded by a
  1944.                                         period.
  1945. note 1) Will not find volume label
  1946.      2) This function does not support network operations
  1947.      3) Wildcards are allowed in the filespec
  1948.      4) If the attribute is zero, only ordinary files are found. If the volume
  1949.         label bit is set, only volume labels will be found. Any other attribute
  1950.         will return that attribute and all normal files together.
  1951.      5) To look for everything except the volume label, set the hidden, system,
  1952.         and subdirectory bits all to 1
  1953.  
  1954.  
  1955. 4Fh  Find Next Matching File (FIND NEXT)
  1956.      Find next ASCIIZ
  1957. entry   AH      4Fh
  1958. return  CF      clear   data block written at current DTA
  1959.                 set     AX      error code (2, 12h)
  1960. note 1) If file found, DTA is formatted as in call 4Eh
  1961.      2) Volume label searches using 4Eh/4Fh reportedly aren't 100% reliable
  1962.         under DOS 2.x. The calls sometime report there's a volume label and
  1963.         point to a garbage DTA, and if the volume label is the only item they
  1964.         often won't find it
  1965.      3) This function does not support network operations
  1966.      4) Use of this call assumes that the original filespec contained wildcards
  1967.  
  1968.  
  1969. 50h   Set PSP
  1970.  *    Set new Program Segment Prefix; current process ID
  1971. entry   AH      50h
  1972.         BX      segment address of new PSP
  1973. return  none - swaps PSP's regarded as current by DOS
  1974. note 1) By putting the PSP segment value into BX and issuing call 50h DOS stores
  1975.         that value into a variable and uses that value whenever a file call is
  1976.         made.
  1977.      2) Note that in the PSP (or PDB) is a table of 20 (decimal) open file
  1978.         handles. The table starts at offset 18h into the PSP. If there is an
  1979.         0FFh in a byte then that handle is not in use. A number in one of the
  1980.         bytes is an index into an internal FB table for that handle. For
  1981.         instance the byte at offset 18h is for handle 0, at offset 19h handle
  1982.         1, etc. up to 13h. If the high bit is set then the file associated by
  1983.         the handle is not shared by child processes EXEC'd with call 4Bh.
  1984.      3) Function 50h is dangerous in background operations prior to DOS 3.x as
  1985.         it uses the wrong stack for saving registers.  (same as functions
  1986.         0..0Ch in DOS 2.x)
  1987.      4) Under DOS 2.x, this function cannot be invoked inside an int 28h handler
  1988.         without setting the Critical Error flag
  1989.      5) Open File information, etc. is stored in the PSP DOS views as current.
  1990.         If a program (eg. a resident program) creates a need for a second PSP,
  1991.         then the second PSP should be set as current to make sure DOS closes
  1992.         that as opposed to the first when the second application finishes.
  1993.      6) See PC Mag Vol.5, No 9, p.314 for discussion.
  1994.  
  1995.  
  1996. 51h   Get Program Segment Prefix
  1997.  *    Returns the PSP address of currently executing program
  1998. entry   AH      51h
  1999. return  BX      address of currently executing program
  2000. note 1) Used in DOS 2.x, 3.x uses 62h
  2001.      2) Function 51h is dangerous in background operations prior to DOS 3.x as
  2002.         it uses the wrong stack for saving registers.  (same as functions
  2003.         0..0Ch in DOS 2.x)
  2004.      3) 50h and 51h might be used if you have more than one process in a PC.
  2005.         For instance if you have a resident program that needs to open a file
  2006.         you could first call 51h to save the current id and then call 50h to set
  2007.         the ID to your PSP.
  2008.      4) Under DOS 2.x, this function cannot be invoked inside an int 28h handler
  2009.  
  2010.  
  2011. 52h     IN-VARS
  2012.  *      returns a pointer to a set of DOS data variables MCB chain, pointer to
  2013.         first device driver and a pointer to disk parameter blocks (first one)
  2014. entry   AH      52h
  2015. return  ES:BX   pointer to the DOS list of lists, for disk information. Does not
  2016.                 access the disk, so information in tables might be incorrect if
  2017.                 disk has been changed. Returns a pointer to the following array
  2018.                 of longword pointers:
  2019.                 Bytes   Value
  2020.                 -2h,-1h segment of first memory control block
  2021.                 0h-3h   pointer to first DOS disk block (see function 36h)
  2022.                 4h-7h   partially unknown. Pointer to a device driver. Maybe
  2023.                         first resident driver?
  2024.                 8h-0Bh  pointer to CLOCK$ device driver, whether installable or
  2025.                         resident
  2026.                 0Ch-0Fh pointer to actual CON: device driver, whether
  2027.                         installable or resident
  2028.         (DOS 2.x)
  2029.                 10      Number of logical drives in system
  2030.                 11-12   Maximum bytes/block of any block device
  2031.                 13-16   unknown
  2032.                 17      Beginning (not a pointer. The real beginning!) of NUL
  2033.                         device driver. This is the first device on DOS's linked
  2034.                         list of device drivers.
  2035.         (DOS 3.x)
  2036.                 10h-11h maximum bytes/block of any block device (0200h)
  2037.                 12h-15h unknown. Pointer to current directory block?
  2038.                 16h-19h partially undefined: Pointer to array of drive info:
  2039.                         51h bytes per drive, starting with A: ...
  2040.                         00h-3Fh current path as ASCIIZ, starting with 'x:\'
  2041.                         40h-43h unknown    zeros always
  2042.                         44h     unknown    flags? Usually 40h, except for
  2043.                                 entry after last valid entry = 00h
  2044.                         45h-48h pointer to DOS disk block for this drive
  2045.                         49h-4Ah unknown. Current track or block?
  2046.                                 -1 if never accessed
  2047.                         4Bh-4Eh unknown  -1 always
  2048.                         4Fh-52h unknown   2 always
  2049.                 1Ah-1Dh unknown. Pointer to data area, maybe including cluster
  2050.                         allocation table?
  2051.                 1Eh-1Fh unknown. Zero always
  2052.                 20h     Number of block devices
  2053.                 21h     value of LASTDRIVE command in CONFIG.SYS (default 5)
  2054.                 22h     Beginning (not a pointer. The real beginning!) of NUL
  2055.                         device driver. This is the first device on DOS's linked
  2056.                         list of device drivers.
  2057. note    This call is not supported in OS/2 1.0's DOS Compatibility Box
  2058.  
  2059.  
  2060. 53h  Translate BPB
  2061.  *   Translates BPB (BIOS Parameter Block, see below) into a DOS Disk Block (see
  2062.      function call 32h).
  2063. entry   AH      53h
  2064.         DS:SI   pointer to BPB
  2065.         ES:BP   pointer to area for DOS Disk Block.
  2066.                 Layout of Disk Block:
  2067.                 bytes   value
  2068.                 00h-01h bytes per sector, get from DDB bytes 02h-03h.
  2069.                 02h     sectors per cluster, get from (DDB byte 4) + 1
  2070.                 03h-04h reserved sectors, get from DDB bytes 06h-07h
  2071.                 05h     number of FATs, get from DDB byte 08h
  2072.                 06h-07h number of root dir entries, get from DDB bytes 09h-0Ah
  2073.                 08h-09h total number of sectors, get from:
  2074.                         ((DDB bytes 0Dh-0Eh) - 1) * (sectors per cluster (BPB
  2075.                         byte 2)) + (DDB bytes 0Bh-0Ch)
  2076.                 0Ah     media descriptor byte, get from DDB byte 16h
  2077.                 0Bh-0Ch number of sectors per FAT, get from DDB byte 0Fh
  2078. return  unknown
  2079.  
  2080.  
  2081. 54h  Get Verify Setting
  2082.      Get verify flag status
  2083. entry   AH      54h
  2084. return  AL      00h if flag off
  2085.                 01h if flag on
  2086. note    Flag can be set with function 2Eh
  2087.  
  2088.  
  2089. 55h  Create "Child" PSP
  2090.  *   Create PSP: similar to function 26h (which creates a new Program Segment
  2091.      Prefix at segment in DX) except creates a "child" PSP rather than copying
  2092.      the existing one.
  2093. entry   AH      55h
  2094.         DX      segment number at which to create new PSP.
  2095. return  unknown
  2096. note 1) This call is similar to call 26h which creates a PSP except that unlike
  2097.         call 26h the segment address of the parent process is obtained from the
  2098.         current process ID rather than from the CS value on the stack (from the
  2099.         INT 21h call). DX has the new PSP value and SI contains the value to be
  2100.         placed into PSP:2 (top of memory).
  2101.      2) Function 55 is merely a substitute for function 26h. It will copy the
  2102.         current PSP to the segment address DX with the addition that SI is
  2103.         assumed to hold the new memory top segment. This means that function
  2104.         26h sets SI to the segment found in the current PSP and then calls
  2105.         function 55h.
  2106.  
  2107.  
  2108. 56h  Rename a File
  2109.      if the first file exists, it is renamed to the name in ES:DI
  2110. entry   AH      56h
  2111.         DS:DX   pointer to ASCIIZ old pathname
  2112.         ES:DI   pointer to ASCIIZ new pathname
  2113. return  CF      clear   successful rename
  2114.                 set     AX      error code (2, 3, 5, 11h)
  2115. note 1) Works with files in same drive only
  2116.      2) Global characters not allowed in filename
  2117.      3) The name of a file is its full pathname. The file's full pathname can
  2118.         be changed, while leaving the actual FILENAME.EXT unchanged. Changing
  2119.         the pathname allows the file to be "moved" from subdirectory to
  2120.         subdirectory on a logical drive without actually copying the file.
  2121.      4) DOS 3.x allows renaming of directories
  2122.  
  2123.  
  2124.  
  2125. 57h  Get/Set a File's Date and Time
  2126.      read or modify time and date stamp on a file's directory entry
  2127. entry   AH      57h
  2128.         AL      function code
  2129.                 00h     get date and time
  2130.                 01h     set date and time
  2131.                         CX      time to be set
  2132.                         DX      date to be set
  2133.         BX      file handle
  2134. return  CF     clear    CX      time of last write (if AL = 0)
  2135.                         DX      date of last write (if AL = 0)
  2136.                set      AX      error code (1, 6)
  2137. note    Date/time formats are:
  2138.         CX bits 0Bh-0Fh hours (0-23)    DX bits 09h-0Fh year (relative to 1980)
  2139.                 05h-0Ah minutes (0-59)          05h-08h month (0-12)
  2140.                 00h-04h #2 sec. incr. (0-29)   00h-04h day of the month (0-31)
  2141.  
  2142.  
  2143. 58h   Get/Set Allocation Strategy
  2144.       DOS 3.x
  2145. entry   AH      58h
  2146.         AL      0       set current strategy
  2147.                 1       set new current strategy
  2148.         BX      new strategy if AH=1
  2149.                 0       first fit - chooses the lowest block in memory which
  2150.                         will fit (this is the default). (use first memory block
  2151.                         large enough)
  2152.                 1       best fit - chooses the smallest block which will fill
  2153.                         the request.
  2154.                 2       last fit - chooses the highest block which will fit.
  2155. return  CF      clear   (0)     successful
  2156.                 set     (1)     error (1)
  2157.                                 AX      error code
  2158.         AX      strategy code (CF=0)
  2159. note 1) Documented in Zenith DOS version 3.1, some in Advanced MSDOS
  2160.      2) The set subfunction accepts any value in BL; 2 or greater means last
  2161.         fit. The get subfunction returns the last value set, so programs should
  2162.         check whether the value is greater than or equal to 2.
  2163.  
  2164.  
  2165. 59h  Get Extended Error Code (DOS 3.x)
  2166.      returns additional error information when requested
  2167.       The Get Extended Error function call (59h) is intended to provide a common
  2168.      set of error codes and to supply more extensive information about the error
  2169.      to the application. The information returned from function call 59h, in
  2170.      addition to the error code, is the error class, the locus, and the
  2171.      recommended action. The error class provides information about the error
  2172.      type (hardware, internal, system, etc.). The locus provides information
  2173.      about the area involved in the failure (serial device, block device,
  2174.      network, or memory). The recommended action provides a default action for
  2175.      programs that do not understand the specific error code.
  2176.        Newly written programs should use the extended error support both from
  2177.      interrupt 24h hard error handlers and after any int 21h function calls. FCB
  2178.      function calls report an error by returning 0FFh in AL. Handle function
  2179.      calls report an error by setting the carry flag and returning the error
  2180.      code in AX. Int 21h handle function calls for DOS 2.x continue to return
  2181.      error codes 0-18. Int 24h handle function calls continue to return error
  2182.      codes 0-12. But the application can obtain any of the error codes used in
  2183.      the extended error codes table by issuing function call 59h. Handle
  2184.      function calls for DOS 3.x can return any of the error codes. However, it
  2185.      is recommended that the function call be followed by function call 59h to
  2186.      obtain the error class, the locus, and the recommended action.
  2187.        The Get Extended Error function (59h) can always be called, regardless of
  2188.      whether the previous DOS call was old style (error code in AL) or new style
  2189.      (carry bit). It can also be used inside an int 24h handler.
  2190.       You can either check AL or the carry bit to see if there was no error,
  2191.      and call function 59h only if there was an error, or take the simple
  2192.      approach of always calling 59h and letting it tell you if there was an
  2193.      error or not. When you call function 59h it will return with AX=0 if the
  2194.      previous DOS call was successful.
  2195. entry   AH      59h
  2196.         BX      version code (0000 for DOS 3.0 and 3.1)
  2197. return  AX      extended error code:
  2198.                 01h     Invalid function number
  2199.                 02h     File not found
  2200.                 03h     Path not found
  2201.                 04h     Too many open files, no file handles left
  2202.                 05h     Access denied
  2203.                 06h     Invalid handle
  2204.                 07h     Memory control blocks destroyed
  2205.                 08h     Insufficient memory
  2206.                 09h     Invalid memory block address
  2207.                 0Ah     Invalid environment
  2208.                 0Bh     Invalid format
  2209.                 0Ch     Invalid access code
  2210.                 0Dh     Invalid data
  2211.                 0Eh     Reserved
  2212.                 0Fh     Invalid drive was specified
  2213.                 10h     Attempt to remove the current directory
  2214.                 11h     Not same device
  2215.                 12h     No more files
  2216.                 13h     Attempt to write on write-protected diskette
  2217.                 14h     Unknown unit
  2218.                 15h     Drive not ready
  2219.                 16h     Unknown command
  2220.                 17h     Bad CRC check
  2221.                 18h     Bad request structure length
  2222.                 19h     Seek error
  2223.                 1Ah     Unknown media type
  2224.                 1Bh     Sector not found
  2225.                 1Ch     Printer out of paper
  2226.                 1Dh     Write fault
  2227.                 1Eh     Read fault
  2228.                 1Fh     General Failure
  2229.                 20h     Sharing violation
  2230.                 21h     Lock violation
  2231.                 22h     Invalid disk change
  2232.                 23h     FCB unavailible
  2233.                 24h     Sharing buffer overflow
  2234.                 25h     Reserved
  2235.                 26h        "
  2236.                 27h        "
  2237.                 28h        "
  2238.                 29h        "
  2239.                 2Ah        "
  2240.                 2Bh        "
  2241.                 2Ch        "
  2242.                 2Dh        "
  2243.                 2Eh        "
  2244.                 2Fh        "
  2245.                 30h        "
  2246.                 31h     Reserved
  2247.                 32h     Network: request not supported (DOS 3.1 + MS Networks)
  2248.                 33h     Remote computer not listening
  2249.                 34h     Duplicate name on network
  2250.                 35h     Network: name not found
  2251.                 36h     Network: busy
  2252.                 37h     Network: device no longer exists
  2253.                 38h     NETBIOS command limit exceeded
  2254.                 39h     Network: adapter hardware error
  2255.                 3Ah     Incorrect response from network
  2256.                 3Bh     Unexpected network error
  2257.                 3Ch     Incompatible remote adapter
  2258.                 3Dh     Print queue full
  2259.                 3Eh     Not enough space for print file
  2260.                 3Fh     Print file was deleted
  2261.                 40h     Network: name was deleted
  2262.                 41h     Network: Access denied
  2263.                 42h     Network: device type incorrect
  2264.                 43h     Network: name not found
  2265.                 44h     Network: name limit exceeded
  2266.                 45h     NETBIOS session limit exceeded
  2267.                 46h     Temporarily paused
  2268.                 47h     Network: request not accepted
  2269.                 48h     Print or disk redirection paused (DOS 3.1 + MS Networks)
  2270.                 49h     Reserved
  2271.                 4Ah        "
  2272.                 4Bh        "
  2273.                 4Ch        "
  2274.                 4Dh        "
  2275.                 4Eh        "
  2276.                 4Fh     Reserved
  2277.                 50h     File exists
  2278.                 51h     Reserved
  2279.                 52h     Cannot make directory entry
  2280.                 53h     Fail on interrupt 24h
  2281.                 54h     Too many redirections
  2282.                 55h     Duplicate redirection
  2283.                 56h     Invalid password
  2284.                 57h     Invalid parameter
  2285.                 58h     Network: device fault
  2286.         BH      class of error:
  2287.                 01h     Out of resource
  2288.                 02h     Temporary situation
  2289.                 03h     Authorization (denied access)
  2290.                 04h     Internal
  2291.                 05h     Hardware failure
  2292.                 06h     System failure
  2293.                 07h     Application program error
  2294.                 08h     Not found
  2295.                 09h     Bad format
  2296.                 0Ah     Locked
  2297.                 0Bh     Media error (wrong volume ID, disk failure)
  2298.                 0Ch     Already exists
  2299.                 0Dh     Unknown
  2300.         BL      suggested action code:
  2301.                 01h     Retry
  2302.                 02h     Delayed retry
  2303.                 03h     Prompt user
  2304.                 04h     Abort after cleanup
  2305.                 05h     Immediate abort
  2306.                 06h     Ignore
  2307.                 07h     Retry after user intervention
  2308.         CH      locus (where error occurred):
  2309.                 01h     Unknown or not appropriate
  2310.                 02h     Block device
  2311.                 03h     Network related
  2312.                 04h     Serial device
  2313.                 05h     Memory related
  2314. note 1) Not all DOS functions use the carry flag to indicate an error. Carry
  2315.         should be tested only on those functions which are documented to use it.
  2316.      2) None of the DOS functions which existed before 2.0 use the carry
  2317.         indicator.  Many of them use register AL as an error indication instead,
  2318.         usually by putting 0FFh in AL on an error. Most, but not all, the "new"
  2319.         (2.x, 3.x) functions do use carry, and most, but not all, of the "old"
  2320.         (1.x) functions use AL.
  2321.      3) On return, CL, DI, DS, DX, ES, BP, and SI are destroyed - save before
  2322.         calling this function if required.
  2323.      4) DOS 2.x Error Codes:  If you are using function calls 38h-57h with DOS
  2324.         2.x, to check if an error has occurred, check for the following error
  2325.         codes in the AX register:
  2326.         call    error code      call    error code      call    error code
  2327.         38h     2               41h     2,3,5           4Ah     7,8,9
  2328.         39h     3,5             42h     1,6             4Bh     1,2,3,5,8,10,11
  2329.         3Ah     3,5,15          43h     1,2,3,5         4Eh     2,3,18
  2330.         3Bh     3               44h     1,3,5,6         4Fh     18
  2331.         3Ch     3,4,5           45h     4,6             56h     2,3,5,17
  2332.         3Dh     2,3,4,5,12      46h     4,6             57h     1,6
  2333.         3Eh     6               47h     15
  2334.         3Fh     5,6             48h     7,8
  2335.         40h     5,6             49h     7,9
  2336.      5) note that extended error codes 13h through 1Fh correspond to error
  2337.         codes 00h through 0Ch returned by int 24h
  2338.  
  2339.  
  2340. 5Ah  Create Temporary File
  2341.      Create unique filename (for temporary use) (DOS 3.x)
  2342. entry   AH      5Ah
  2343.         DS:DX   pointer to ASCIIZ directory pathname ending with a backslash (\)
  2344.         CX      file attribute
  2345. return  CF      clear   DS:DX   new ASCIIZ path name
  2346.                         AX      handle
  2347.                 set     AX      error code (3 or 5)
  2348. note 1) The file created is not truly "temporary". It must be removed by the
  2349.         user.
  2350.      2) If the filename created already exists in the current directory, this
  2351.         function will call itself again with another unique filename until
  2352.         a unique filename is found
  2353.  
  2354.  
  2355. 5Bh  Create a New File
  2356.      (DOS 3.x)
  2357. entry   AH      5Bh
  2358.         DS:DX   pointer to directory ASCIIZ path name
  2359.         CX      file attribute
  2360. return  CF      clear   AX      file handle
  2361.                         DS:DX   new ASCIIZ path name
  2362.                 set     AX      error code (3, 4, 5, 50h)
  2363. note 1) Unlike function 3Ch, function 5Bh will fail if the file already exists.
  2364.      2) The new file is opened in read/write mode
  2365.  
  2366.  
  2367. 5Ch  Lock/Unlock File Access
  2368.      (DOS 3.x)
  2369. entry   AH      5Ch
  2370.         AL      00h     to lock file
  2371.                 01h     to unlock file
  2372.         BX      file handle
  2373.         CX:DX   starting offset of region to lock
  2374.         SI:DI   size of region  to lock
  2375. return  CF      clear   successful
  2376.                 set     AX      error code (1, 6, 21h)
  2377. note 1) Close all files before exiting or undefined results may occur
  2378.      2) Programs spawned with EXEC inherit all the parent's file handles but
  2379.         not the file locks
  2380.  
  2381.  
  2382. 5Dh  Set Extended Error Information
  2383.  *   DOS  Internal - partial (DOS 3.x)
  2384. entry   AH      5dh
  2385.         AL      subfunction
  2386.                 06h     get address of critical error flag
  2387.                         return  DS:SI   pointer to critical error flag
  2388.                 08h     (unknown - used by command.com)
  2389.                 09h     (unknown - used by command.com)
  2390.                 0Ah     set error info (Error, Class, Action, and Locus)
  2391.                         DS:DX   address of 11-word error information
  2392.                                 words 0 to 7: values of AX,BX,CX,DX,SI,DI,DS,
  2393.                                               ES that function 59h will return
  2394.                                 words 8 to 10: zero (reserved)
  2395. return: CX      unknown
  2396.         DX      unknown
  2397.         DS:SI   (for 06h) pointer to critical error flag
  2398. note 1) This call seems to have many different functions
  2399.      2) Function 0Ah; DOS 3.1+
  2400.      3) Function 06h; setting CritErr flag allows use of functions 50h/51h from
  2401.         int 28h under DOS 2.x by forcing use of correct stack
  2402.  
  2403.  
  2404. 5Eh     Network Printer  (Partially documented by Microsoft)
  2405.         DOS 3.1+ with Networks software
  2406. entry   AH      5Eh
  2407.         AL      00      Get Machine Name
  2408.                         DS:DX   pointer to buffer for ASCIIZ name
  2409.                         return  CH      0       if name not defined
  2410.                                 CL      NETBIOS name number if CH <> 0
  2411.                                 DS:DX   pointer to identifier if CH <> 0
  2412.                         note    the ASCIIZ name is a 15 byte string padded
  2413.                                 to length with zeroes
  2414.                 01      Set Machine Name
  2415.                         DS:DX   pointer to ASCIIZ name
  2416.                         CH      unknown
  2417.                         CL      name number
  2418.                 02      Set Printer Control String
  2419.                         BX      redirection list index
  2420.                         CX      length of setup string (max 64 bytes)
  2421.                         DS:SI   pointer to string buffer
  2422.                 03      Get Printer Control String
  2423.                         BX      redirection list index
  2424.                         ES:DI   pointer to string buffer
  2425.                         return  CX      length of setup string (max 64 bytes)
  2426. return  CF      clear   successful
  2427.                 set     error
  2428.                         AX      error code (1 for all listed subfunctions)
  2429. note 1) Used in IBM's & Microsoft's Network programs
  2430.      2) Partial documentation in Fall 1985 Byte
  2431.      3) These services require that the network software be installed
  2432.      4) Partial documentation in Advanced MS-DOS
  2433.      5) SHARE must be loaded or results can be unpredictable on 00h, or fail
  2434.         with 02h or 03h
  2435.  
  2436.  
  2437. 5Fh     Network Redirection
  2438.         (DOS 3.1 + Microsoft Networks)
  2439. entry   AH      5Fh
  2440.         AL     *00h     Unknown
  2441.                *01h     Unknown
  2442.                 02h     Get Redirection List Entry
  2443.                         BX      redirection list index
  2444.                         DS:SI   pointer to 16 byte buffer for local device name
  2445.                         ES:DI   pointer to 128 byte buffer for network name
  2446.                         return  BH      device status flag (bit 0 = 0 if valid)
  2447.                                                           (bit 0 = 1 if invalid)
  2448.                                 BL      device type
  2449.                                         03      printer device
  2450.                                         04      drive device
  2451.                                 CX      stored parameter value
  2452.                                 DS:SI   pointer to 16 byte local device name
  2453.                                 ES:DI   pointer to 128 byte network name
  2454.                         note    DX and BP are destroyed by this call!
  2455.                 03h     Redirect Device
  2456.                         BL      device type
  2457.                                 03      printer device
  2458.                                 04      file device
  2459.                         CX      stored parameter value
  2460.                         DS:SI   pointer to source device name
  2461.                         ES:DI   pointer to destination ASCIIZ network path +
  2462.                                 ASCIIZ password
  2463.                 04h     Cancel Redirection
  2464.                         DS:SI   pointer to ASCIIZ device name or network path
  2465. return  CF      clear   successful
  2466.                 set     if error
  2467.                         AX      error code
  2468. return  as above
  2469. note 1) Used in IBM's Network program
  2470.      2) Partial documentation in Fall 1985 Byte
  2471.      3) These services require that the network software be installed
  2472.      4) Partial documentation in Advanced MS-DOS
  2473.      5) SHARE must be loaded or the call will fail
  2474.      6) The network device name requires a password
  2475.  
  2476.  
  2477. 60h     Parse pathname (DOS 3.x)
  2478.  *      Translate - perform name processing on a string (internal to DOS)
  2479. entry   AH      60h
  2480.         DS:SI   pointer to source string (null terminated)
  2481.         ES:DI   pointer to destination string buffer.
  2482. return  ES:DI   buffer filled with qualified name
  2483.         CF      0       no error
  2484.                 1       error
  2485.                         AX      error code
  2486. note 1) Documented in Zenith 3.05 Tech Ref
  2487.      2) All name processing is performed on the input string: string
  2488.         substitution is performed on the components, current drive/directories
  2489.         are prepended, .  and ..  are removed.
  2490.      3) Example: If current drive/directory is c:\test,  myfile.x is translated
  2491.         to c:\test\myfile.x; ..\source\sample.asm is tranlated to c:\source\
  2492.         sample.asm
  2493.      4) It is the caller's responsibility to make sure DS:SI does not point to
  2494.         a null string. If it does, SI is incremented, a null byte is stored at
  2495.         ES:DI, and the routine returns.
  2496.  
  2497.  
  2498. 61h     No Information Availible  (DOS 3.x)
  2499.  *      internal to DOS - parameters not known
  2500. entry   AH      61h
  2501. return  AL      0
  2502. note    Supposedly documented in Zenith DOS 3.05 Tech Ref
  2503.  
  2504.  
  2505. 62h  Get Program Segment Prefix (PSP)
  2506.      Get PSP address (DOS 3.x)
  2507. entry   AH      62h
  2508. return  BX      segment address of PSP
  2509.  
  2510.  
  2511. 63h  Get Lead Byte Table  (MS-DOS 2.25 only)
  2512.      added in MS-DOS version 2.25 for additional foreign character set support.
  2513. entry   AH      63h
  2514.         AL      subfunction
  2515.                 00h     get system lead byte table address
  2516.                 01h     set/clear interim console flag
  2517.                         DL      0 to clear interim console flag
  2518.                                 1 to set interim console flag
  2519.                 02h     get interim console flag
  2520. return  DS:SI   pointer to lead byte table (AL = 00h)
  2521.         DL      interim console flag (AL = 02h)
  2522. note    Function 63h destroys all registers on return.
  2523.  
  2524.  
  2525. 64h  Internal
  2526.      unknown (DOS 3.3+)
  2527. entry   AH      64h
  2528.  
  2529.  
  2530. 65h  Get Extended Country Information (DOS 3.3+)
  2531.      returns information about the selected country formats, code pages, and
  2532.      conversion tables
  2533. entry   AH      65h
  2534.         AL      info ID (1 - 6)
  2535.         BX      code page (-1 = global code page)
  2536.         CX      size of buffer
  2537.         DX      country ID (-1 = current country)
  2538.         ES:DI   pointer to country information buffer
  2539. return  AX      error code if carry set, otherwise
  2540.         CX      size of country information returned
  2541.         CF      set on error
  2542.         ES:DI   pointer to country information:
  2543.                 1 byte info ID
  2544.                 if info ID <> 1
  2545.                     dword  pointer to information
  2546.                 if info ID = 1
  2547.                     word   size
  2548.                     word   country ID
  2549.                     word   code page
  2550.                  34 bytes  (see function 38h)
  2551.  
  2552.  
  2553. 66h   Get/Set Global Code Page Table (DOS 3.3+)
  2554.       query/reset code page defaults
  2555. entry   AH      66h
  2556.         AL      00h     Get Global Code Page
  2557.                 01h     Set Global Page
  2558.                         BX      active code page
  2559.                         DX      system code page (active page at boot time)
  2560. return  CF      clear  successful
  2561.                 set    AX       error code
  2562.         if 00h         BX       active code page
  2563.                        DX       system code page (active page at boot time)
  2564. note    BX = active code page: 437 = US, 860 = Portugal, 863 = Canada (French)
  2565.                                865 = Norway/Denmark
  2566.  
  2567.  
  2568. 67h  Set Handle Count  (DOS 3.3+)
  2569.      supports more than 20 open files per process
  2570. entry   AH      67h
  2571.         BX      desired number of handles (max 255)
  2572. return  CF      clear if OK
  2573.         CF      set if error
  2574.                 AX      error code
  2575.  
  2576.  
  2577. 68h  Commit File (DOS 3.3+)
  2578.      Write all buffered data to disk
  2579. entry   AH      68h
  2580.         BX      file handle
  2581. return  CF      set     AX      error code
  2582.                 clear   successful
  2583. note    Faster and more secure method of closing a file in a network than
  2584.         current close commands
  2585.  
  2586.  
  2587. 69h     Disk Serial Number  DOS 4.0 (US)
  2588.         Places and reads "Volume Serial Number" on disks formatted with 4.0+
  2589. entry   unknown
  2590. return  unknown
  2591. note    A call for DOS function 69h (AL=0, possibly a subfunction) uses DS:DX
  2592.         as a pointer to a table. On return, the table is filled in as follows:
  2593.         word            unknown (zeroes on my system)
  2594.         dword           disk serial number (binary)
  2595.         char[11]        volume label or "NO NAME    " if none
  2596.         char[8]         FAT type
  2597.         The FAT type field returns "FAT16   " on hard disk formatted with DOS
  2598.         3.3 and "FAT12   " on a 360K floppy.
  2599.  
  2600.  
  2601. 6Ah     unknown  (DOS 4.0?)
  2602.  
  2603.  
  2604. 6Bh     unknown  (DOS 4.0?)
  2605.  
  2606.  
  2607. 6Ch     Extended Open/Create  DOS 4.0 (US)
  2608.         Combines functions available with Open, Create, Create New, and Commit
  2609. entry   AH      6Ch
  2610.         AL      00h  reserved  [which means there might be other subfunctions?]
  2611.         BX      mode    format  0WF0 0000 ISSS 0AAA
  2612.                                 AAA is access code (read, write, read/write)
  2613.                                 SSS is sharing mode
  2614.                                 I       0       pass handle to child
  2615.                                         1       no inherit [interesting!]
  2616.                                 F       0       use int 24h for errors
  2617.                                         1       disable int 24h for all
  2618.                                                 I/O on this handle; use own
  2619.                                                 error routine
  2620.                                 W       0       no commit
  2621.                                         1       auto commit on all writes
  2622.         CX      create attribute
  2623.         DL      action if file exists/does not exists
  2624.                 bits 7-4 action if file does not exist
  2625.                          0000   fail
  2626.                          0001   create
  2627.                 bits 3-0 action if file exists
  2628.                          0000    fail
  2629.                          0001    open
  2630.                          0010    replace/open
  2631.         DH      0
  2632.         DS:SI   pointer to ASCIIZ file name
  2633. return  CF      set on error
  2634.                 AX      error code
  2635.                 clear
  2636.                 AX      file handle
  2637.                 CX      action taken
  2638.                         01h     file opened
  2639.                         02h     created/opened
  2640.                         03h     replaced/opened
  2641.  
  2642.  
  2643. 89h  DOS_Sleep
  2644.  *   not documented by Microsoft
  2645. entry   AH      89h
  2646. return  unknown
  2647. note 1) Function included in Microsoft C 4.0 startup code MSDOS.INC
  2648.      2) Debugging shows that the first instruction on entry to DOS compares AH
  2649.         with 64h (at least in DOS 3.2) and aborts the call if AH > 64.
  2650.      3) Possibly used in European MSDOS 4.0?
  2651.  
  2652.  
  2653. Aftermarket Application Installed Function Calls:
  2654.  
  2655.  
  2656. 0B6h, 0B8h, 0BBh, 0BCh, B0Eh, 0BFh, 0C0h, 0C1h, 0C2h, 0C3h, 0C4h, 0C5h, 0C6h,
  2657. 0C7h, 0C8h, 0C9h, 0CAh, 0CBh, 0CCh, 0CDh, 0CEh, 0CFh, 0D0h, 0D1h, 0D2h, 0D3h,
  2658. 0D4h, 0D5h, 0D6h, 0D7h, 0DAh, 0DBh
  2659.         Used by Novell NetWare
  2660.  
  2661.  
  2662. 0DCh    Novell NetWare
  2663.         Get Station Number
  2664. entry   AH      0DCh
  2665. return  AL      station number
  2666.                 00h     if NetWare not loaded or this machine is a non-
  2667.                         dedicated server
  2668.  
  2669.  
  2670. 0DDh    Novell NetWare
  2671.  
  2672.  
  2673. 0DEh    Novell NetWare
  2674.         Set Broadcast Mode
  2675.  
  2676. 0DFh    Novell NetWare
  2677.  
  2678.  
  2679. 0E0h    Novell NetWare
  2680.  
  2681.  
  2682. 0E1h    Novell NetWare
  2683.         Broadcast Messages
  2684. entry   AH      E1h
  2685.         AL      00h     send broadcast message
  2686.                 01h     get broadcase message
  2687.                 02h-09h unknown
  2688.  
  2689. 0E2h    Novell NetWare
  2690.  
  2691.  
  2692. 0E3h    Novell NetWare
  2693.         Connection Control
  2694. entry   AH      E3h
  2695.         AL      00h-14h unknown
  2696.                 15h     get object connection numbers
  2697.                 16h     get connection information
  2698.                 32h-47h unknown
  2699.  
  2700.  
  2701. E4h    DoubleDOS
  2702.         check status
  2703. entry   AX      00h
  2704. return  AL      <> 0 if DoubleDOS is active
  2705.  
  2706. 0E4h    Novell NetWare
  2707.  
  2708.  
  2709. 0E5h, 0E6h, 0E7h, 0E8h, 0E9h
  2710.         Novell NetWare
  2711.  
  2712.  
  2713. 0EAh    DoubleDOS
  2714.         turn off task switching
  2715. entry   AX      EAh
  2716. return  task switching turned off
  2717.  
  2718.  
  2719. 0EAh    Novell NetWare
  2720.  
  2721.  
  2722. 0EBh    DoubleDOS
  2723.         turn on task switching
  2724. entry   AH      EBh
  2725. return  Task switching turned on
  2726.  
  2727.  
  2728. 0EBh    Novell NetWare
  2729.  
  2730.  
  2731. 0ECh    DoubleDOS
  2732.         get virtual screen address
  2733. entry   AH      ECh
  2734. return  ES      segment of virtual screen
  2735. note    Screen address can change if task switching is on!
  2736.  
  2737.  
  2738. 0ECh    Novell NetWare
  2739.  
  2740.  
  2741. 0EDh    Novell NetWare
  2742.  
  2743.  
  2744. 0EEh    DoubleDOS
  2745.         give away time to other tasks
  2746. entry   AH      EEh
  2747.         AL      number of 55ms time slices to give away
  2748. return  Returns after giving away time slices
  2749.  
  2750.  
  2751. 0EEh    Novell NetWare
  2752.         Get Node Address
  2753. entry   AH      EEh
  2754. return  CX:BX:AX = six-byte address
  2755.  
  2756.  
  2757. 0EFh, 0F0h, 0F1h, 0F2h, 0F3h  Reportedly used by Novell NetWare.
  2758.         No parameters known
  2759.  
  2760.  
  2761. 0FFh    CED   (CJ Dunford's DOS macro and command-line editor)
  2762.         CED installable commands
  2763. entry   AH      0FFh
  2764.         AL      00h     add installable command
  2765.                 01h     remove installable command
  2766.                 02h     reserved, may be used to test for CED installation
  2767.         BL      mode    bit 0 = 1 callable from DOS prompt
  2768.                         bit 1 = 1 callable from application
  2769.         DS:SI   pointer to cr-terminated command name
  2770.         ES:DI   pointer to far routine entry point
  2771. return  CF      set on error
  2772.         AX      01h     invalid function
  2773.                 02h     command not found (subfunction 1 only)
  2774.                 08h     insufficient memory (subfunction 0 only)
  2775.                 0Eh     bad data (subfunction 0 only)
  2776.         AH      0FFh    if CED not installed
  2777.  
  2778.